summaryrefslogtreecommitdiff
path: root/common/tree.c
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2011-11-22 23:56:50 +0000
committerShawn Routhier <sar@isc.org>2011-11-22 23:56:50 +0000
commitb95f1ee0701f658fbbbe497f535564717fbe604e (patch)
treea3c1458c4456fbbc7633ef2300ca5b812920fe07 /common/tree.c
parent7595a1a7725c3484e2f3fd942e44507b845adc0a (diff)
downloadisc-dhcp-b95f1ee0701f658fbbbe497f535564717fbe604e.tar.gz
Add a check for a null pointer before calling the regexec function.
Without out this check we could, under some circumstances, pass a null pointer to the regexec function causing it to segfault. [ISC-Bugs #26704].
Diffstat (limited to 'common/tree.c')
-rw-r--r--common/tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/common/tree.c b/common/tree.c
index d09107b8..20b2bc64 100644
--- a/common/tree.c
+++ b/common/tree.c
@@ -1120,6 +1120,7 @@ int evaluate_boolean_expression (result, packet, lease, client_state,
*result = 0;
memset(&re, 0, sizeof(re));
if (bleft && bright &&
+ (left.data != NULL) &&
(regcomp(&re, (char *)right.data, regflags) == 0) &&
(regexec(&re, (char *)left.data, (size_t)0, NULL, 0) == 0))
*result = 1;