summaryrefslogtreecommitdiffstats
path: root/sbin/dhclient/clparse.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2011-12-17 01:19:07 +0000
committerdim <dim@FreeBSD.org>2011-12-17 01:19:07 +0000
commitb10871ad5bc05f5e1d2d18765cd0728ef81badaa (patch)
tree72284c3f91f7cef9e3747ae67f25435e7fe8a9af /sbin/dhclient/clparse.c
parent47dd4657eab2f1d399b8ca595dfa14326d41927a (diff)
downloadFreeBSD-src-b10871ad5bc05f5e1d2d18765cd0728ef81badaa.zip
FreeBSD-src-b10871ad5bc05f5e1d2d18765cd0728ef81badaa.tar.gz
In sbin/dhclient, work around warnings about the size argument to
strlcpy appearing to be the size of the source buffer, instead of the destination. MFC after: 1 week
Diffstat (limited to 'sbin/dhclient/clparse.c')
-rw-r--r--sbin/dhclient/clparse.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/dhclient/clparse.c b/sbin/dhclient/clparse.c
index 7c1e74f..fea935a 100644
--- a/sbin/dhclient/clparse.c
+++ b/sbin/dhclient/clparse.c
@@ -873,6 +873,7 @@ parse_string_list(FILE *cfile, struct string_list **lp, int multiple)
{
int token;
char *val;
+ size_t valsize;
struct string_list *cur, *tmp;
/* Find the last medium in the media list. */
@@ -890,10 +891,11 @@ parse_string_list(FILE *cfile, struct string_list **lp, int multiple)
return;
}
- tmp = new_string_list(strlen(val) + 1);
+ valsize = strlen(val) + 1;
+ tmp = new_string_list(valsize);
if (tmp == NULL)
error("no memory for string list entry.");
- strlcpy(tmp->string, val, strlen(val) + 1);
+ strlcpy(tmp->string, val, valsize);
tmp->next = NULL;
/* Store this medium at the end of the media list. */
OpenPOWER on IntegriCloud