# HG changeset patch # User Mike Becker # Date 1499024101 -7200 # Node ID f24b730cb75e5622333203fdef63ef74f45afe31 # Parent e2579b63595a6e1625e9782e9135edce1985b507 token parser checks if token of class DAVQL_TOKEN_NUMBER consists of digits only diff -r e2579b63595a -r f24b730cb75e libidav/davqlparser.c --- a/libidav/davqlparser.c Tue Feb 07 18:36:28 2017 +0100 +++ b/libidav/davqlparser.c Sun Jul 02 21:35:01 2017 +0200 @@ -475,6 +475,13 @@ if (isdigit(firstchar)) { token->tokenclass = DAVQL_TOKEN_NUMBER; + // check, if all characters are digits + for (size_t i = 1 ; i < token->value.length ; i++) { + if (!isdigit(token->value.ptr[i])) { + token->tokenclass = DAVQL_TOKEN_INVALID; + break; + } + } } else if (firstchar == '%') { token->tokenclass = DAVQL_TOKEN_FMTSPEC; } else if (token->value.length == 1) { @@ -496,6 +503,7 @@ token->tokenclass = DAVQL_TOKEN_KEYWORD; } else { token->tokenclass = DAVQL_TOKEN_IDENTIFIER; + // TODO: check for illegal characters } // remove quotes (extreme cool feature) diff -r e2579b63595a -r f24b730cb75e mingw.mk --- a/mingw.mk Tue Feb 07 18:36:28 2017 +0100 +++ b/mingw.mk Sun Jul 02 21:35:01 2017 +0200 @@ -42,6 +42,6 @@ LIB_EXT = .a APP_EXT = .exe -DAV_CFLAGS = -I /mingw/include/libxml2 +DAV_CFLAGS = -I/usr/include/libxml2 DAV_LDFLAGS = -lcurl -lxml2 -lssl -lcrypto -lws2_32 -lgdi32 -lregex