summaryrefslogtreecommitdiff
path: root/ext/pdo_dblib
diff options
context:
space:
mode:
authorStanley Sufficool <ssufficool@php.net>2014-10-20 21:44:47 -0700
committerStanley Sufficool <ssufficool@php.net>2014-10-20 21:44:47 -0700
commit09cf64678a76fbbe9eb897a128b65dc5618f2ad1 (patch)
tree3649a1c8ae794d5c964197f2868989eeb9f69f95 /ext/pdo_dblib
parent8defcb855ab01d9c8ab4759cb793d80149b55a8c (diff)
downloadphp-git-09cf64678a76fbbe9eb897a128b65dc5618f2ad1.tar.gz
Fix bug #67134 (PDO_DBLIB Missing null string terminator)
Diffstat (limited to 'ext/pdo_dblib')
-rw-r--r--ext/pdo_dblib/dblib_stmt.c5
1 files changed, 2 insertions, 3 deletions
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;
}