Simple workaround to protect our sizing functions from walking past
the end of allocation.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95285
13f79535-47bb-0310-9956-
ffa450edef68
}
else
{
- pValue = apr_palloc(p, nSize);
+ /* Small possiblity the array is either unterminated
+ * or single NULL terminated. Avert.
+ */
+ pValue = apr_palloc(p, nSize + 2);
+ pValue[nSize + 1] = '\0';
+ pValue[nSize] = '\0';
+
rv = RegQueryValueEx(hKey,
name, /* key name */
NULL, /* reserved */