2
0
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:
Ted Lemon 1996-06-10 22:45:02 +00:00
parent 955d158bd0
commit efdf1d6ec1
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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);