mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-29 05:17:57 +00:00
Fix ANSI string botch, allocate space for NUL on ASCII string
This commit is contained in:
parent
955d158bd0
commit
efdf1d6ec1
@ -466,7 +466,7 @@ void parse_shared_net_statement (cfile, bc)
|
||||
parse_warn ("zero-length shared network name");
|
||||
val = "<no-name-given>";
|
||||
}
|
||||
name = dmalloc (strlen (val), "parse_shared_net_statement");
|
||||
name = dmalloc (strlen (val) + 1, "parse_shared_net_statement");
|
||||
if (!name)
|
||||
error ("no memory for shared network name");
|
||||
strcpy (name, val);
|
||||
@ -951,7 +951,7 @@ void parse_option_decl (cfile, bc, options)
|
||||
tree_const (val,
|
||||
strlen (val)));
|
||||
} else {
|
||||
parse_warn ("expecting string %s."
|
||||
parse_warn ("expecting string %s.",
|
||||
"or hexadecimal data");
|
||||
skip_to_semi (cfile);
|
||||
longjmp (jdref (bc), 1);
|
||||
|
@ -466,7 +466,7 @@ void parse_shared_net_statement (cfile, bc)
|
||||
parse_warn ("zero-length shared network name");
|
||||
val = "<no-name-given>";
|
||||
}
|
||||
name = dmalloc (strlen (val), "parse_shared_net_statement");
|
||||
name = dmalloc (strlen (val) + 1, "parse_shared_net_statement");
|
||||
if (!name)
|
||||
error ("no memory for shared network name");
|
||||
strcpy (name, val);
|
||||
@ -951,7 +951,7 @@ void parse_option_decl (cfile, bc, options)
|
||||
tree_const (val,
|
||||
strlen (val)));
|
||||
} else {
|
||||
parse_warn ("expecting string %s."
|
||||
parse_warn ("expecting string %s.",
|
||||
"or hexadecimal data");
|
||||
skip_to_semi (cfile);
|
||||
longjmp (jdref (bc), 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user