From: Denys Vlasenko Date: Sun, 6 Feb 2011 17:00:58 +0000 (+0100) Subject: udhcpc: fix a problem with binary-encoded options X-Git-Tag: 1_19_0~339 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=fbea22056014a05a0c6619eb458d4955869b5e93;p=oweals%2Fbusybox.git udhcpc: fix a problem with binary-encoded options function old new delta attach_option 395 413 +18 Signed-off-by: Denys Vlasenko --- diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c index 311f79e7e..0a60261ab 100644 --- a/networking/udhcp/common.c +++ b/networking/udhcp/common.c @@ -375,7 +375,7 @@ static NOINLINE void attach_option( new->data = xmalloc(length + OPT_DATA); new->data[OPT_CODE] = optflag->code; new->data[OPT_LEN] = length; - memcpy(new->data + OPT_DATA, buffer, length); + memcpy(new->data + OPT_DATA, (allocated ? allocated : buffer), length); curr = opt_list; while (*curr && (*curr)->data[OPT_CODE] < optflag->code)