]> granicus.if.org Git - apache/commitdiff
Just in case...
authorJim Jagielski <jim@apache.org>
Wed, 20 Jan 2016 17:37:19 +0000 (17:37 +0000)
committerJim Jagielski <jim@apache.org>
Wed, 20 Jan 2016 17:37:19 +0000 (17:37 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725762 13f79535-47bb-0310-9956-ffa450edef68

server/util_expr_eval.c

index d3c981276f4310764d63a879f8452169a03081a9..4db48d3966e8065ef3546c027cb7bfccd592ba6a 100644 (file)
@@ -1067,7 +1067,8 @@ static const char *kb_func(ap_expr_eval_ctx_t *ctx, const void *data,
 
     buf = apr_palloc(ctx->r->pool, len);
     apr_brigade_flatten(ctx->r->kept_body, buf, &len);
-    buf[len-1] = '\0'; /* ensure */
+    if (len)
+        buf[len-1] = '\0'; /* ensure */
     return (const char*)buf;
 }