Skip to content

Commit baccc0e

Browse files
committed
Update link.c
1 parent 1195f27 commit baccc0e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

ext/standard/link.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ PHP_FUNCTION(linkinfo)
8484
Z_PARAM_PATH(link, link_len)
8585
ZEND_PARSE_PARAMETERS_END();
8686

87-
// TODO Check for empty string
87+
if (UNEXPECTED(link_len == 0)) {
88+
php_error_docref(NULL, E_WARNING, "%s", strerror(ENOENT));
89+
RETURN_LONG(Z_L(-1));
90+
}
91+
8892
dirname = estrndup(link, link_len);
8993
zend_dirname(dirname, link_len);
9094

0 commit comments

Comments
 (0)