mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Avoid segfault if parser `ref' is empty
This commit is contained in:
parent
f65b08b066
commit
c035e76ede
@ -19,12 +19,12 @@ GEOIP_CPPFLAGS=""
|
|||||||
GEOIP_LDADD=""
|
GEOIP_LDADD=""
|
||||||
GEOIP_LDFLAGS=""
|
GEOIP_LDFLAGS=""
|
||||||
GEOIP_CONFIG=${PKG_CONFIG}
|
GEOIP_CONFIG=${PKG_CONFIG}
|
||||||
GEOIP_PKGNAMES="geoip2 geoip GeoIP libGeoIP"
|
GEOIP_PKGNAMES="geoip2 geoip GeoIP"
|
||||||
GEOIP_SONAMES="so la sl dll dylib"
|
GEOIP_SONAMES="so la sl dll dylib"
|
||||||
|
|
||||||
AC_ARG_WITH(
|
AC_ARG_WITH(
|
||||||
geoip,
|
geoip,
|
||||||
[AC_HELP_STRING([--with-geoip=PATH],[Path to geoip prefix])]
|
[AC_HELP_STRING([--with-geoip=PATH],[Path to geoip prefix or config script])]
|
||||||
,, with_geoip=yes)
|
,, with_geoip=yes)
|
||||||
|
|
||||||
AS_CASE(["${with_geoip}"],
|
AS_CASE(["${with_geoip}"],
|
||||||
|
@ -167,7 +167,9 @@ void Driver::error(const yy::location& l, const std::string& m,
|
|||||||
const std::string& c) {
|
const std::string& c) {
|
||||||
if (parserError.tellp() == 0) {
|
if (parserError.tellp() == 0) {
|
||||||
parserError << "Rules error. ";
|
parserError << "Rules error. ";
|
||||||
|
if (ref.empty() == false) {
|
||||||
parserError << "File: " << ref.back() << ". ";
|
parserError << "File: " << ref.back() << ". ";
|
||||||
|
}
|
||||||
parserError << "Line: " << l.end.line << ". ";
|
parserError << "Line: " << l.end.line << ". ";
|
||||||
parserError << "Column: " << l.end.column << ". ";
|
parserError << "Column: " << l.end.column << ". ";
|
||||||
}
|
}
|
||||||
|
@ -1,8 +0,0 @@
|
|||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
|
|
||||||
int main(int argc, char **argv) {
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user