diff options
author | Frank M. Kromann <fmk@php.net> | 2001-10-17 18:36:32 +0000 |
---|---|---|
committer | Frank M. Kromann <fmk@php.net> | 2001-10-17 18:36:32 +0000 |
commit | 29c090934b44d6b1a8c3bb355258777b44c9a1d2 (patch) | |
tree | 6be702863145337b440017724f3796ec02c31d72 /ext/fbsql/php_fbsql.c | |
parent | a90e5f5a6b00362f9e6e52d1e46e032b8d26143a (diff) | |
download | php-git-29c090934b44d6b1a8c3bb355258777b44c9a1d2.tar.gz |
Return a warning when fbsql_read_blob or fbsql_read_clob is called with an invalid handle
Diffstat (limited to 'ext/fbsql/php_fbsql.c')
-rw-r--r-- | ext/fbsql/php_fbsql.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/fbsql/php_fbsql.c b/ext/fbsql/php_fbsql.c index e4ac0ca3c2..73f296c2d4 100644 --- a/ext/fbsql/php_fbsql.c +++ b/ext/fbsql/php_fbsql.c @@ -1031,8 +1031,13 @@ static void php_fbsql_read_lob(INTERNAL_FUNCTION_PARAMETERS, int lob_type) ZEND_FETCH_RESOURCE2(phpLink, PHPFBLink *, fbsql_link_index, id, "FrontBase-Link", le_link, le_plink); convert_to_string_ex(lob_handle); - length = fbcbhBlobSize((FBCBlobHandle *)Z_STRVAL_PP(lob_handle)); + if (Z_STRLEN_PP(lob_handle) != 27 || Z_STRVAL_PP(lob_handle)[0] != '@') { + if (FB_SQL_G(generateWarnings)) php_error(E_WARNING, "The handle is invalid"); + RETURN_FALSE; + } + + length = fbcbhBlobSize((FBCBlobHandle *)Z_STRVAL_PP(lob_handle)); if (lob_type == 0) value = estrndup((char *)fbcdcReadBLOB(phpLink->connection, (FBCBlobHandle *)Z_STRVAL_PP(lob_handle)), length); else |