Commit 8f26a85d authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Ignore NULL pointers in vmod.to{upper|lower}()



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@5410 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 2059d760
......@@ -55,11 +55,13 @@ vmod_updown(struct sess *sp, int up, const char *s, va_list ap)
e += u;
p = s;
while (p != vrt_magic_string_end && b < e) {
for (; b < e && *p != '\0'; p++)
if (up)
*b++ = toupper(*p);
else
*b++ = tolower(*p);
if (p != NULL) {
for (; b < e && *p != '\0'; p++)
if (up)
*b++ = toupper(*p);
else
*b++ = tolower(*p);
}
p = va_arg(ap, const char *);
}
if (b < e)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment