Commit f587bdf3 authored by William A. Rowe Jr's avatar William A. Rowe Jr
Browse files

  Small chance we have an unterminated or single null terminated list.
  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
parent 525320bd
Loading
Loading
Loading
Loading
+7 −1
Changes for server/mpm/winnt/registry.c: 7 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -258,7 +258,13 @@ apr_status_t ap_registry_get_array(apr_pool_t *p, const char *key, const char *n
    }
    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 */