From: Stanley Sufficool Date: Tue, 21 Oct 2014 04:44:47 +0000 (-0700) Subject: Fix bug #67134 (PDO_DBLIB Missing null string terminator) X-Git-Tag: POST_NATIVE_TLS_MERGE^2~49^2~44 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09cf64678a76fbbe9eb897a128b65dc5618f2ad1;p=php Fix bug #67134 (PDO_DBLIB Missing null string terminator) --- diff --git a/ext/pdo_dblib/dblib_stmt.c b/ext/pdo_dblib/dblib_stmt.c index a29405b24e..5909f6407f 100644 --- a/ext/pdo_dblib/dblib_stmt.c +++ b/ext/pdo_dblib/dblib_stmt.c @@ -255,12 +255,11 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, break; } case SQLUNIQUE: { - *len = 36+1; + *len = 37; tmp_ptr = emalloc(*len + 1); - - /* uniqueidentifier is a 16-byte binary number, convert to 32 char hex string */ *len = dbconvert(NULL, SQLUNIQUE, *ptr, *len, SQLCHAR, tmp_ptr, *len); php_strtoupper(tmp_ptr, *len); + tmp_ptr[36] = '\0'; *ptr = tmp_ptr; break; }