Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102694739
D26246.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D26246.diff
View Options
Index: head/usr.sbin/ctld/kernel.c
===================================================================
--- head/usr.sbin/ctld/kernel.c
+++ head/usr.sbin/ctld/kernel.c
@@ -238,10 +238,16 @@
cur_lun->backend_type = str;
str = NULL;
} else if (strcmp(name, "lun_type") == 0) {
+ if (str == NULL)
+ log_errx(1, "%s: %s missing its argument", __func__, name);
cur_lun->device_type = strtoull(str, NULL, 0);
} else if (strcmp(name, "size") == 0) {
+ if (str == NULL)
+ log_errx(1, "%s: %s missing its argument", __func__, name);
cur_lun->size_blocks = strtoull(str, NULL, 0);
} else if (strcmp(name, "blocksize") == 0) {
+ if (str == NULL)
+ log_errx(1, "%s: %s missing its argument", __func__, name);
cur_lun->blocksize = strtoul(str, NULL, 0);
} else if (strcmp(name, "serial_number") == 0) {
cur_lun->serial_number = str;
@@ -357,15 +363,23 @@
cur_port->port_name = str;
str = NULL;
} else if (strcmp(name, "physical_port") == 0) {
+ if (str == NULL)
+ log_errx(1, "%s: %s missing its argument", __func__, name);
cur_port->pp = strtoul(str, NULL, 0);
} else if (strcmp(name, "virtual_port") == 0) {
+ if (str == NULL)
+ log_errx(1, "%s: %s missing its argument", __func__, name);
cur_port->vp = strtoul(str, NULL, 0);
} else if (strcmp(name, "cfiscsi_target") == 0) {
cur_port->cfiscsi_target = str;
str = NULL;
} else if (strcmp(name, "cfiscsi_state") == 0) {
+ if (str == NULL)
+ log_errx(1, "%s: %s missing its argument", __func__, name);
cur_port->cfiscsi_state = strtoul(str, NULL, 0);
} else if (strcmp(name, "cfiscsi_portal_group_tag") == 0) {
+ if (str == NULL)
+ log_errx(1, "%s: %s missing its argument", __func__, name);
cur_port->cfiscsi_portal_group_tag = strtoul(str, NULL, 0);
} else if (strcmp(name, "ctld_portal_group_name") == 0) {
cur_port->ctld_portal_group_name = str;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 11:20 PM (21 h, 40 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14667377
Default Alt Text
D26246.diff (1 KB)
Attached To
Mode
D26246: Make sure not to pass NULL to strtoul(3)
Attached
Detach File
Event Timeline
Log In to Comment