diff options
| author | Zeev Suraski <zeev@php.net> | 2005-04-07 13:59:45 +0000 | 
|---|---|---|
| committer | Zeev Suraski <zeev@php.net> | 2005-04-07 13:59:45 +0000 | 
| commit | 779f5c5c195037347699d7f352d16063adb80a8c (patch) | |
| tree | 8769db0c765ba9b579b12d18c29ab1b976c03306 /Zend/zend_alloc.h | |
| parent | cd47b3c54286e312f5f14437fe65411e100d4328 (diff) | |
| download | php-git-779f5c5c195037347699d7f352d16063adb80a8c.tar.gz | |
Fix strdup() bug when USE_ZEND_ALLOC is disabled
Diffstat (limited to 'Zend/zend_alloc.h')
| -rw-r--r-- | Zend/zend_alloc.h | 8 | 
1 files changed, 5 insertions, 3 deletions
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h index 1a85e74dc4..c35661996c 100644 --- a/Zend/zend_alloc.h +++ b/Zend/zend_alloc.h @@ -134,6 +134,8 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE  #include <string.h>  #undef _GNU_SOURCE +char *_strndup(char *s, uint l); +																   /* Standard wrapper macros */  #define emalloc(size)					malloc(size)  #define safe_emalloc(nmemb, size, offset)		malloc((nmemb) * (size) + (offset)) @@ -142,7 +144,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE  #define erealloc(ptr, size)				realloc((ptr), (size))  #define erealloc_recoverable(ptr, size)	realloc((ptr), (size))  #define estrdup(s)						strdup(s) -#define estrndup(s, length)				strndup((s), (length)) +#define estrndup(s, length)				_strndup((s), (length))  /* Relay wrapper macros */  #define emalloc_rel(size)					malloc(size) @@ -152,7 +154,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE  #define erealloc_rel(ptr, size)				realloc((ptr), (size))  #define erealloc_recoverable_rel(ptr, size)	realloc((ptr), (size))  #define estrdup_rel(s)						strdup(s) -#define estrndup_rel(s, length)				strndup((s), (length)) +#define estrndup_rel(s, length)				_strndup((s), (length))  /* Selective persistent/non persistent allocation macros */  #define pemalloc(size, persistent)		malloc(size) @@ -171,7 +173,7 @@ ZEND_API char *_estrndup(const char *s, unsigned int length ZEND_FILE_LINE_DC ZE  #define pestrdup_rel(s, persistent)			strdup(s)  #define safe_estrdup(ptr)  ((ptr)?(strdup(ptr)):(empty_string)) -#define safe_estrndup(ptr, len) ((ptr)?(strndup((ptr), (len))):(empty_string)) +#define safe_estrndup(ptr, len) ((ptr)?(_strndup((ptr), (len))):(empty_string))  #endif  | 
