Lines 589-594
Link Here
|
589 |
|
589 |
|
590 |
#define GETSTR(_var) \ |
590 |
#define GETSTR(_var) \ |
591 |
MIN_LENGTH (sizeof (char)); \ |
591 |
MIN_LENGTH (sizeof (char)); \ |
|
|
592 |
if (*(char*)p == '\0') continue; \ |
592 |
if (_var) free (_var); \ |
593 |
if (_var) free (_var); \ |
593 |
_var = xmalloc (length + 1); \ |
594 |
_var = xmalloc (length + 1); \ |
594 |
memcpy (_var, p, length); \ |
595 |
memcpy (_var, p, length); \ |
Lines 632-638
Link Here
|
632 |
MIN_LENGTH (1); |
633 |
MIN_LENGTH (1); |
633 |
if (dhcp->dnssearch) |
634 |
if (dhcp->dnssearch) |
634 |
free (dhcp->dnssearch); |
635 |
free (dhcp->dnssearch); |
635 |
if ((len = decode_search (p, length, NULL)) > 0) { |
636 |
/* FIXME: decode_search() also reserves space for '\0' */ |
|
|
637 |
if ((len = decode_search (p, length, NULL)) > 1) { |
636 |
dhcp->dnssearch = xmalloc (len); |
638 |
dhcp->dnssearch = xmalloc (len); |
637 |
decode_search (p, length, dhcp->dnssearch); |
639 |
decode_search (p, length, dhcp->dnssearch); |
638 |
} |
640 |
} |