diff options
Diffstat (limited to 'ext/pgsql/pgsql.c')
| -rw-r--r-- | ext/pgsql/pgsql.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index f73bf062d6..6aee07e890 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -2730,7 +2730,8 @@ static unsigned char * php_pgsql_unescape_bytea(unsigned char *strtext, size_t * break; } } - buffer = erealloc(buffer, buflen); + buffer[buflen] = '\0'; + buffer = erealloc(buffer, buflen+1); if (buffer == NULL) return NULL; |
