[git commit master 1/1] udhcpc: fix a problem with binary-encoded options

Denys Vlasenko vda.linux at googlemail.com
Sun Feb 6 17:00:58 UTC 2011


commit: http://git.busybox.net/busybox/commit/?id=fbea22056014a05a0c6619eb458d4955869b5e93
branch: http://git.busybox.net/busybox/commit/?id=refs/heads/master

function                                             old     new   delta
attach_option                                        395     413     +18

Signed-off-by: Denys Vlasenko <vda.linux at googlemail.com>
---
 networking/udhcp/common.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c
index 311f79e..0a60261 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)
-- 
1.7.3.4



More information about the busybox-cvs mailing list