2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-08-31 06:15:55 +00:00

Clean up a possible memory smash in the binding code.

This commit is contained in:
Ted Lemon
2000-06-12 22:22:09 +00:00
parent 5b01171a9d
commit 55321a210e
2 changed files with 6 additions and 3 deletions

View File

@@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: tree.c,v 1.82 2000/05/17 16:04:04 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
"$Id: tree.c,v 1.83 2000/06/12 22:22:08 mellon Exp $ Copyright (c) 1995-2000 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@@ -486,10 +486,11 @@ int evaluate_expression (result, packet, lease,
binding_scope_dereference (&ns, MDL);
return 0;
} else {
memset (nb, 0, sizeof *nb);
nb -> name = dmalloc (strlen (s -> string) + 1,
MDL);
if (nb -> name)
strcpy (binding -> name, s -> string);
strcpy (nb -> name, s -> string);
else {
dfree (nb, MDL);
nb = (struct binding *)0;