projects
/
freeradius.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
c4232ce
)
Check return code of regcomp. Closes #583
author
Alan T. DeKok
<aland@freeradius.org>
Thu, 28 Aug 2008 14:14:33 +0000
(16:14 +0200)
committer
Alan T. DeKok
<aland@freeradius.org>
Thu, 28 Aug 2008 14:14:33 +0000
(16:14 +0200)
src/main/valuepair.c
patch
|
blob
|
history
diff --git
a/src/main/valuepair.c
b/src/main/valuepair.c
index
3ef2574
..
526a15a
100644
(file)
--- a/
src/main/valuepair.c
+++ b/
src/main/valuepair.c
@@
-80,8
+80,15
@@
int radius_compare_vps(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp)
/*
* Include substring matches.
*/
- regcomp(®, (char *)check->vp_strvalue,
- REG_EXTENDED);
+ compare = regcomp(®, check->vp_strvalue, REG_EXTENDED);
+ if (compare != 0) {
+ char buffer[256];
+ regerror(compare, ®, buffer, sizeof(buffer));
+
+ RDEBUG("Invalid regular expression %s: %s",
+ check->vp_strvalue, buffer);
+ return -1;
+ }
compare = regexec(®, value, REQUEST_MAX_REGEX + 1,
rxmatch, 0);
regfree(®);