Browse Source

- Fixed bug #54395 (Phar::mount() crashes when calling with wrong parameters)

pull/12/head
Felipe Pena 15 years ago
parent
commit
4929964a5d
  1. 4
      NEWS
  2. 2
      ext/phar/phar_object.c
  3. 16
      ext/phar/tests/bug54395.phpt

4
NEWS

@ -38,6 +38,10 @@ PHP NEWS
- PDO PostgreSQL driver:
. Fixed bug #54318 (Non-portable grep option used in PDO pgsql
configuration). (bwalton at artsci dot utoronto dot ca)
- Phar extension:
. Fixed bug #54395 (Phar::mount() crashes when calling with wrong parameters).
(Felipe)
- SOAP extension:
. Fixed bug #54312 (soap_version logic bug). (tom at samplonius dot org)

2
ext/phar/phar_object.c

@ -628,7 +628,7 @@ carry_on:
}
return;
} else if (SUCCESS == zend_hash_find(&(PHAR_GLOBALS->phar_fname_map), fname, fname_len, (void **)&pphar)) {
} else if (PHAR_GLOBALS->phar_fname_map.arBuckets && SUCCESS == zend_hash_find(&(PHAR_GLOBALS->phar_fname_map), fname, fname_len, (void **)&pphar)) {
goto carry_on;
} else if (PHAR_G(manifest_cached) && SUCCESS == zend_hash_find(&cached_phars, fname, fname_len, (void **)&pphar)) {
if (SUCCESS == phar_copy_on_write(pphar TSRMLS_CC)) {

16
ext/phar/tests/bug54395.phpt

@ -0,0 +1,16 @@
--TEST--
Bug #54395 (Phar::mount() crashes when calling with wrong parameters)
--SKIPIF--
<?php if (!extension_loaded("phar")) die("skip"); ?>
--FILE--
<?php
try {
phar::mount(1,1);
} catch (Exception $e) {
var_dump($e->getMessage());
}
?>
--EXPECTF--
string(25) "Mounting of 1 to 1 failed"
Loading…
Cancel
Save