summaryrefslogtreecommitdiff
path: root/ext/mcrypt/mcrypt.c
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2001-09-07 07:51:06 +0000
committerDerick Rethans <derick@php.net>2001-09-07 07:51:06 +0000
commitc117b309502c5a6f84d163df9ae24425e4f6189f (patch)
tree8a944b01c7516443fc54ed01573d00bfdc3dff72 /ext/mcrypt/mcrypt.c
parentb7a1b197345e2a088dbf91a25d1157985cbd3d1f (diff)
downloadphp-git-c117b309502c5a6f84d163df9ae24425e4f6189f.tar.gz
- MFH (Fix for bug 13052)
Diffstat (limited to 'ext/mcrypt/mcrypt.c')
-rw-r--r--ext/mcrypt/mcrypt.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c
index 600e9ae379..4f1954a641 100644
--- a/ext/mcrypt/mcrypt.c
+++ b/ext/mcrypt/mcrypt.c
@@ -456,6 +456,11 @@ PHP_FUNCTION(mcrypt_generic_init)
max_key_size = mcrypt_enc_get_key_size (td);
iv_size = mcrypt_enc_get_iv_size (td);
+ if (Z_STRLEN_PP(key) == 0) {
+ php_error (E_WARNING, "key size is 0");
+ RETURN_FALSE;
+ }
+
key_s = emalloc (Z_STRLEN_PP(key));
memset (key_s, 0, Z_STRLEN_PP(key));