summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2009-11-03 10:48:12 +0000
committerPierre Joye <pajoye@php.net>2009-11-03 10:48:12 +0000
commit26e3082abca953a2add5ae02b6fd3f6f301e00ec (patch)
tree02ad7ca25b2034c63128ec4db2b3f6a01cbc04c1 /TSRM
parent826ca288e752d12f893d198d48a3c50aa873f18b (diff)
downloadphp-git-26e3082abca953a2add5ae02b6fd3f6f301e00ec.tar.gz
- fix lenght for alloc and cpy (Kanwal)
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/tsrm_win32.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 44f6495d58..229ff23fe7 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -111,7 +111,7 @@ char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
char *bucket_key = NULL;
if (!pSid) {
- bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname));
+ bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + 1);
if (!bucket_key) {
return NULL;
}
@@ -123,14 +123,14 @@ char * tsrm_win32_get_path_sid_key(const char *pathname TSRMLS_DC)
return NULL;
}
- bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid));
+ bucket_key = (char *)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, strlen(pathname) + strlen(ptcSid) + 1);
if (!bucket_key) {
LocalFree(ptcSid);
return NULL;
}
memcpy(bucket_key, ptcSid, strlen(ptcSid));
- memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname));
+ memcpy(bucket_key + strlen(ptcSid), pathname, strlen(pathname) + 1);
LocalFree(ptcSid);
return bucket_key;