2
0
mirror of https://gitlab.isc.org/isc-projects/dhcp synced 2025-09-01 14:55:30 +00:00

Update 26704 to include a null check on the right hand side as well.

This commit is contained in:
Shawn Routhier
2011-11-28 18:01:25 +00:00
parent 846af1cd69
commit c535de4411
2 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
.\" $Id: dhcp-eval.5,v 1.31 2010/07/02 23:09:14 sar Exp $ .\" $Id: dhcp-eval.5,v 1.32 2011/11/28 18:01:25 sar Exp $
.\" .\"
.\" Copyright (c) 2009-2010 by Internet Systems Consortium, Inc. ("ISC") .\" Copyright (c) 2009-2011 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC") .\" Copyright (c) 2004,2007 by Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (c) 1996-2003 by Internet Software Consortium .\" Copyright (c) 1996-2003 by Internet Software Consortium
.\" .\"
@@ -133,8 +133,8 @@ extended regex(7) matching of the values of two data expressions, returning
true if \fIdata-expression-1\fR matches against the regular expression true if \fIdata-expression-1\fR matches against the regular expression
evaluated by \fIdata-expression-2\fR, or false if it does not match or evaluated by \fIdata-expression-2\fR, or false if it does not match or
encounters some error. If either the left-hand side or the right-hand side encounters some error. If either the left-hand side or the right-hand side
are null, the result is also false. The \fB~~\fR operator differs from the are null or empty strings, the result is also false. The \fB~~\fR operator
\fB~=\fR operator in that it is case-insensitive. differs from the \fB~=\fR operator in that it is case-insensitive.
.RE .RE
.PP .PP
.I boolean-expression-1 \fBand\fR \fIboolean-expression-2\fR .I boolean-expression-1 \fBand\fR \fIboolean-expression-2\fR

View File

@@ -1120,7 +1120,7 @@ int evaluate_boolean_expression (result, packet, lease, client_state,
*result = 0; *result = 0;
memset(&re, 0, sizeof(re)); memset(&re, 0, sizeof(re));
if (bleft && bright && if (bleft && bright &&
(left.data != NULL) && (left.data != NULL) && (right.data != NULL) &&
(regcomp(&re, (char *)right.data, regflags) == 0) && (regcomp(&re, (char *)right.data, regflags) == 0) &&
(regexec(&re, (char *)left.data, (size_t)0, NULL, 0) == 0)) (regexec(&re, (char *)left.data, (size_t)0, NULL, 0) == 0))
*result = 1; *result = 1;