cvs: pecl /hyperwave hw.c

From: Date: Fri, 20 Oct 2006 07:22:39 +0000
Subject: cvs: pecl /hyperwave hw.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-6518@lists.php.net to get a copy of this message
steinm Fri Oct 20 07:22:39 2006 UTC Modified files: /pecl/hyperwave hw.c Log: - added quick and dirty fix for segm fault in make_objrec_from_array() http://cvs.php.net/viewvc.cgi/pecl/hyperwave/hw.c?r1=1.131&r2=1.132&diff_format=u Index: pecl/hyperwave/hw.c diff -u pecl/hyperwave/hw.c:1.131 pecl/hyperwave/hw.c:1.132 --- pecl/hyperwave/hw.c:1.131 Tue Aug 22 14:45:59 2006 +++ pecl/hyperwave/hw.c Fri Oct 20 07:22:39 2006 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: hw.c,v 1.131 2006/08/22 14:45:59 steinm Exp $ */ +/* $Id: hw.c,v 1.132 2006/10/20 07:22:39 steinm Exp $ */ #include <stdlib.h> #include <errno.h> @@ -597,7 +597,10 @@ strarr = make_objrec_from_array(Z_ARRVAL_P(keydata), ':'); len = strlen(strarr) - 1; keylen = strlen(key); - if(NULL == (ptr = malloc(len + 2 + count*(keylen+1)))) { + /* Adding 20 is just for security. 2 has been too + * less. Needs fixing. + */ + if(NULL == (ptr = emalloc(len + 20 + count*(keylen+1)))) { free(objrec); free(strarr); return(NULL); @@ -620,7 +623,7 @@ *ptr1 = '\0'; strlcpy(str, ptr, sizeof(str)); free(strarr); - free(ptr); + efree(ptr); } break; } @@ -4008,6 +4011,7 @@ anchorrecs = make_strs_from_array(arrht); arrht = Z_ARRVAL_PP(arg3); dest = make_strs_from_array(arrht); + count = hwdoc->size; if (0 != (error = send_insertanchors(&(hwdoc->data), &count, anchorrecs, dest, zend_hash_num_elements(arrht), urlprefix, &bodytag))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Command returned %d", error); @@ -4028,6 +4032,7 @@ php_info_print_table_start(); php_info_print_table_row(2, "Hyperwave Support", "enabled"); php_info_print_table_row(2, "HG-CSP Version", "7.17"); + php_info_print_table_row(2, "RCS Version", "$Id: hw.c,v 1.132 2006/10/20 07:22:39 steinm Exp $"); php_info_print_table_end(); DISPLAY_INI_ENTRIES(); }

« previous php.pecl.cvs (#6518) next »