Fix crash with empty DHCP string options.

This commit is contained in:
Simon Kelley committed 2013-07-02 21:19:32 +01:00
1 parent b4b9308079
commit 625ac28c61
2 files changed
+5 -1

No files matched your search

+2 -1
View File
@@ -1833,7 +1833,8 @@ static int do_opt(struct dhcp_opt *opt, unsigned char *p, struct dhcp_context *c
}
}
else
memcpy(p, opt->val, len);
/* empty string may be extended to "\0" by null_term */
memcpy(p, opt->val ? opt->val : (unsigned char *)"", len);
}
return len;
}