diff options
author | Pierrick Charron <pierrick@php.net> | 2011-08-08 03:08:59 +0000 |
---|---|---|
committer | Pierrick Charron <pierrick@php.net> | 2011-08-08 03:08:59 +0000 |
commit | 08a499f14218de5be05b2e324d304512c667c867 (patch) | |
tree | ee6e6c7cd0df1cdcb03444b354f17c490a93c420 /Zend/zend.c | |
parent | 44e2c266c30e788e20eaa2f5098e5ca9172728c9 (diff) | |
download | php-git-08a499f14218de5be05b2e324d304512c667c867.tar.gz |
Use snprintf and strncat to make the static analyzers happy
Diffstat (limited to 'Zend/zend.c')
-rw-r--r-- | Zend/zend.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index bcfedebd96..56ccd516d0 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -821,7 +821,7 @@ void zend_append_version_info(const zend_extension *extension) /* {{{ */ char *new_info; uint new_info_length; - new_info_length = sizeof(" with v, by \n") + new_info_length = sizeof(" with v, , by \n") + strlen(extension->name) + strlen(extension->version) + strlen(extension->copyright) @@ -829,10 +829,10 @@ void zend_append_version_info(const zend_extension *extension) /* {{{ */ new_info = (char *) malloc(new_info_length + 1); - sprintf(new_info, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author); + snprintf(new_info, new_info_length, " with %s v%s, %s, by %s\n", extension->name, extension->version, extension->copyright, extension->author); zend_version_info = (char *) realloc(zend_version_info, zend_version_info_length+new_info_length + 1); - strcat(zend_version_info, new_info); + strncat(zend_version_info, new_info, new_info_length); zend_version_info_length += new_info_length; free(new_info); } |