From: Michael Stapelberg Date: Tue, 20 Sep 2011 20:42:26 +0000 (+0100) Subject: A bit more boundary-checking when replacing variables. X-Git-Tag: 4.1~143^2^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cd6c3fedcb89b8ae995ca1afac2789aef5567de8;p=i3%2Fi3 A bit more boundary-checking when replacing variables. Makes valgrind happy --- diff --git a/src/cfgparse.y b/src/cfgparse.y index f8e84ae9..f1843312 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -390,6 +390,7 @@ void parse_file(const char *f) { int extra = (strlen(current->value) - strlen(current->key)); char *next; for (next = bufcopy; + (bufcopy + (next - bufcopy)) < (buf + stbuf.st_size) && (next = strcasestr(bufcopy + (next - bufcopy), current->key)) != NULL; next += strlen(current->key)) { *next = '_';