Module Name: src Committed By: mbalmer Date: Thu Oct 17 07:31:31 UTC 2013
Modified Files: src/libexec/httpd: lua-bozo.c Log Message: zero allocated memory buffers To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/libexec/httpd/lua-bozo.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/libexec/httpd/lua-bozo.c diff -u src/libexec/httpd/lua-bozo.c:1.1 src/libexec/httpd/lua-bozo.c:1.2 --- src/libexec/httpd/lua-bozo.c:1.1 Sat Oct 12 17:24:07 2013 +++ src/libexec/httpd/lua-bozo.c Thu Oct 17 07:31:31 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: lua-bozo.c,v 1.1 2013/10/12 17:24:07 mbalmer Exp $ */ +/* $NetBSD: lua-bozo.c,v 1.2 2013/10/17 07:31:31 mbalmer Exp $ */ /* * Copyright (c) 2013 Marc Balmer <m...@msys.ch> @@ -91,6 +91,7 @@ lua_read(lua_State *L) len = luaL_checkinteger(L, -1); data = bozomalloc(httpd, len + 1); + memset(data, 0, len + 1); bozo_read(httpd, STDIN_FILENO, data, len); lua_pushstring(L, data); free(data); @@ -406,7 +407,8 @@ bozo_process_lua(bozo_httpreq_t *request if (clen && *clen && atol(clen) > 0) { length = atol(clen); content = bozomalloc(httpd, - length); + length + 1); + memset(content, 0, length + 1); bozo_read(httpd, STDIN_FILENO, content, length); lua_decode_query(map->L,