cvs: php4 /ext/sysvshm sysvshm.c
| From: | Derick Rethans | Date: | Thu, 22 Nov 2001 14:33:35 +0000 |
| Subject: | cvs: php4 /ext/sysvshm sysvshm.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-8284@lists.php.net to get a copy of this message | ||
derick Thu Nov 22 09:33:35 2001 EDT
Modified files:
/php4/ext/sysvshm sysvshm.c
Log:
- Fix crach bug if the parameter to shm_remove is not a valid identifier.
Index: php4/ext/sysvshm/sysvshm.c
diff -u php4/ext/sysvshm/sysvshm.c:1.51 php4/ext/sysvshm/sysvshm.c:1.52
--- php4/ext/sysvshm/sysvshm.c:1.51 Sun Nov 11 06:08:31 2001
+++ php4/ext/sysvshm/sysvshm.c Thu Nov 22 09:33:35 2001
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sysvshm.c,v 1.51 2001/11/11 11:08:31 thies Exp $ */
+/* $Id: sysvshm.c,v 1.52 2001/11/22 14:33:35 derick Exp $ */
/* This has been built and tested on Linux 2.2.14
*
@@ -208,6 +208,12 @@
id = Z_LVAL_PP(arg_id);
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
+
+ if (!shm_list_ptr) {
+ php_error(E_WARNING, "The parameter is not a valid shm_indentifier");
+ RETURN_FALSE;
+ }
+
if(shmctl(shm_list_ptr->id,IPC_RMID,NULL)<0) {
php_error(E_WARNING, "shm_remove() failed for key 0x%x, id %i: %s",
shm_list_ptr->key, id,strerror(errno));
RETURN_FALSE;