CVS update: php3/functions
| From: | danny | Date: | Mon, 17 Aug 1998 18:20:13 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-285@lists.php.net to get a copy of this message | ||
Date: Monday August 17, 1998 @ 14:20
Author: danny
Update of /repository/php3/functions
In directory asf:/tmp/cvs-serv29123/functions
Modified Files:
ifx.ec
Log Message:
-Bug in memory allocation for large blobs
-ifx_htmltbl_result : properly terminate string for TEXT blobs.
Index: php3/functions/ifx.ec
diff -c php3/functions/ifx.ec:1.9 php3/functions/ifx.ec:1.10
*** php3/functions/ifx.ec:1.9 Sun Aug 16 10:50:43 1998
--- php3/functions/ifx.ec Mon Aug 17 14:20:12 1998
***************
*** 1741,1748 ****
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_size + 4;
! locator->loc_buffer = (char *)malloc(locator->loc_bufsize + 4);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
locator->loc_bufsize);
--- 1741,1748 ----
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_indicator + 4;
! locator->loc_buffer = (char *)malloc(locator->loc_bufsize);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
locator->loc_bufsize);
***************
*** 1762,1769 ****
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_size + 4;
! locator->loc_buffer = (char *)malloc(locator->loc_bufsize + 4);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
locator->loc_bufsize);
--- 1762,1769 ----
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_indicator + 4;
! locator->loc_buffer = (char *)malloc(locator->loc_bufsize);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
locator->loc_bufsize);
***************
*** 2019,2026 ****
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_size + 4;
! locator->loc_buffer = (char *)malloc(locator->loc_bufsize + 4);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
locator->loc_bufsize);
--- 2019,2026 ----
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_indicator + 4;
! locator->loc_buffer = (char *)malloc(locator->loc_bufsize);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
locator->loc_bufsize);
***************
*** 2041,2047 ****
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_size + 4;
locator->loc_buffer = (char *)malloc(locator->loc_bufsize + 4);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
--- 2041,2047 ----
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_indicator + 4;
locator->loc_buffer = (char *)malloc(locator->loc_bufsize + 4);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
***************
*** 2333,2340 ****
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_size + 4;
! locator->loc_buffer = (char *)malloc(locator->loc_bufsize + 4);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
locator->loc_bufsize);
--- 2333,2340 ----
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
if (locator->loc_status < 0) { /* blob too large */
free(locator->loc_buffer);
! locator->loc_bufsize = locator->loc_indicator + 4;
! locator->loc_buffer = (char *)malloc(locator->loc_bufsize);
if (locator->loc_buffer == NULL) {
php3_error(E_WARNING,"no memory (%d bytes) for blob",
locator->loc_bufsize);
***************
*** 2342,2347 ****
--- 2342,2348 ----
}
EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator = DATA;
}
+ locator->loc_buffer[locator->loc_size] = 0;
php3_printf("<td>%s</td>", locator->loc_buffer);
break;
case SQLBYTES :
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net