Skip to content

Commit ce3a240

Browse files
committed
ext/phar/utils.c: Change if guard to assertion in phar_get_link_location()
This condition is checked before calling it at the unique call site, effectively being dead code. An assertion is clearer.
1 parent 8d28c05 commit ce3a240

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

ext/phar/util.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ static zend_result phar_call_openssl_signverify(bool is_sign, php_stream *fp, ze
4141
static char *phar_get_link_location(phar_entry_info *entry) /* {{{ */
4242
{
4343
char *p, *ret = NULL;
44-
if (!entry->link) {
45-
return NULL;
46-
}
44+
45+
ZEND_ASSERT(entry->link);
46+
4747
if (entry->link[0] == '/') {
4848
return estrdup(entry->link + 1);
4949
}

0 commit comments

Comments
 (0)