1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00

MFB: Fixed bug #46798 (Crash in mssql extension when retrieving a NULL value

inside a binary or image column type)
This commit is contained in:
Ilia Alshanetsky
2008-12-10 20:54:47 +00:00
parent c0defbdc81
commit 8424c90476
2 changed files with 11 additions and 6 deletions
+3 -1
View File
@@ -4,8 +4,10 @@ PHP NEWS
- Fixed security issue in imagerotate(), background colour isn't validated
correctly with a non truecolour image. (Scott)
- Fixed bug #46798 (Crash in mssql extension when retrieving a NULL value
inside a binary or image column type). (Ilia)
- Fixed bug #46782 (fastcgi.c parse error). (Matt)
- Fixed bug #46748 (Segfault when an SSL error has more than one error.) (Scott)
- Fixed bug #46748 (Segfault when an SSL error has more than one error). (Scott)
- Fixed bug #46739 (array returned by curl_getinfo should contain content_type key).
(Mikko)
+8 -5
View File
@@ -876,11 +876,14 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off
unsigned char *res_buf;
int res_length = dbdatlen(mssql_ptr->link, offset);
res_buf = (unsigned char *) emalloc(res_length+1);
bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));
memcpy(res_buf,bin,res_length);
res_buf[res_length] = '\0';
ZVAL_STRINGL(result, res_buf, res_length, 0);
if (!res_length) {
ZVAL_NULL(result);
} else {
bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));
res_buf = (unsigned char *) emalloc(res_length+1);
memcpy(res_buf,bin,res_length);
res_buf[res_length] = '\0';
ZVAL_STRINGL(result, res_buf, res_length, 0);
}
break;
case SQLNUMERIC: