]> code.delx.au - pulseaudio/commitdiff
core-util: Check that we actually have regexec before we use it
authorPeter Meerwald <p.meerwald@bct-electronic.com>
Fri, 29 Nov 2013 14:58:42 +0000 (15:58 +0100)
committerTanu Kaskinen <tanu.kaskinen@linux.intel.com>
Fri, 6 Dec 2013 11:30:27 +0000 (13:30 +0200)
Thanks to Pierre Ossman for reporting the bug and providing an initial
fix on which this patch is based.

BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=69708
src/pulsecore/core-util.c

index a2c3a391255ce5ff45930008567d897197daf23e..06c38841ac5dd5cda226291874c5198ee7e480f8 100644 (file)
@@ -954,6 +954,7 @@ void pa_reset_priority(void) {
 }
 
 int pa_match(const char *expr, const char *v) {
+#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
     int k;
     regex_t re;
     int r;
@@ -976,6 +977,10 @@ int pa_match(const char *expr, const char *v) {
         errno = EINVAL;
 
     return r;
+#else
+    errno = ENOSYS;
+    return -1;
+#endif
 }
 
 /* Try to parse a boolean string value.*/