INIT allow a trailing / in iscsi_parse_portal_url()

This commit is contained in:
Peter Lieven
2012-10-30 11:47:12 +01:00
parent 774ede1f46
commit 9f82d0bf83

View File

@@ -388,6 +388,8 @@ iscsi_parse_full_url(struct iscsi_context *iscsi, const char *url)
}
memset(iscsi_url, 0, sizeof(struct iscsi_url));
strncpy(iscsi_url->portal,portal,MAX_STRING_SIZE);
strncpy(iscsi_url->target,target,MAX_STRING_SIZE);
@@ -437,6 +439,9 @@ iscsi_parse_portal_url(struct iscsi_context *iscsi, const char *url)
}
}
tmp=strchr(portal,'/');
if (tmp) *tmp=0;
iscsi_url = malloc(sizeof(struct iscsi_url));
if (iscsi_url == NULL) {
iscsi_set_error(iscsi, "Out-of-memory: Failed to allocate iscsi_url structure");