Skip to content

Commit

Permalink
Fix ASAN warning (Zend/zend_string.h:165:2: runtime error: null point…
Browse files Browse the repository at this point in the history
…er passed as argument 2 of memcpy(), which is declared to never be null)
  • Loading branch information
dstogov committed Mar 4, 2021
1 parent 4f478af commit 187ba43
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ext/phar/util.c
Original file line number Diff line number Diff line change
@@ -1389,7 +1389,11 @@ static int phar_call_openssl_signverify(int is_sign, php_stream *fp, zend_off_t
zend_string *str;

ZVAL_STRINGL(&openssl, is_sign ? "openssl_sign" : "openssl_verify", is_sign ? sizeof("openssl_sign")-1 : sizeof("openssl_verify")-1);
ZVAL_STRINGL(&zp[1], *signature, *signature_len);
if (*signature_len) {
ZVAL_STRINGL(&zp[1], *signature, *signature_len);
} else {
ZVAL_EMPTY_STRING(&zp[1]);
}
ZVAL_STRINGL(&zp[2], key, key_len);
php_stream_rewind(fp);
str = php_stream_copy_to_mem(fp, (size_t) end, 0);

0 comments on commit 187ba43

Please sign in to comment.