Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed possible crash in php_mssql_get_column_content_without_type()

# Also fix NEWS entry in PHP_5_2 for previous commit
  • Loading branch information...
commit faac456bde8195148b46ecc08394553ee8b36820 1 parent 20f4bdc
@KalleZ KalleZ authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 ext/mssql/php_mssql.c
View
8 ext/mssql/php_mssql.c
@@ -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';
Please sign in to comment.
Something went wrong with that request. Please try again.