mirror of
https://github.com/php/php-src.git
synced 2025-01-20 10:43:40 +08:00
Fixed possible crash in php_mssql_get_column_content_without_type()
# Also fix NEWS entry in PHP_5_2 for previous commit
This commit is contained in:
parent
20f4bdc399
commit
faac456bde
@ -1059,6 +1059,14 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int
|
||||
unsigned char *res_buf;
|
||||
int res_length = dbdatlen(mssql_ptr->link, offset);
|
||||
|
||||
if (res_length == 0) {
|
||||
ZVAL_NULL(result);
|
||||
return;
|
||||
} else if (res_length < 0) {
|
||||
ZVAL_FALSE(result);
|
||||
return;
|
||||
}
|
||||
|
||||
res_buf = (unsigned char *) emalloc(res_length+1);
|
||||
bin = ((DBBINARY *)dbdata(mssql_ptr->link, offset));
|
||||
res_buf[res_length] = '\0';
|
||||
|
Loading…
Reference in New Issue
Block a user