]> granicus.if.org Git - apache/commitdiff
Simple fix for possibly unterminated REG_SZ data
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 25 May 2002 20:09:24 +0000 (20:09 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 25 May 2002 20:09:24 +0000 (20:09 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95286 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/registry.c

index 0fe03b65ccc3743826ce5b3d73c82b65ac6ecb74..4b5b3261b0314cfdb5ede555851f4d80e0c03150 100644 (file)
@@ -211,7 +211,9 @@ apr_status_t ap_registry_get_value(apr_pool_t *p, const char *key, const char *n
     if (rv != ERROR_SUCCESS)
        return_error(rv);
 
-    *ppValue = apr_palloc(p, nSize);
+    *ppValue = apr_palloc(p, nSize + 1);
+    (*ppValue)[nSize] = '\0';
+
     rv = RegQueryValueEx(hKey, 
                         name,          /* key name */
                         NULL,          /* reserved */