Skip to content

phar module, unsignedness check changes. #3309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions ext/phar/phar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1853,14 +1853,14 @@ static int phar_check_str(const char *fname, const char *ext_str, size_t ext_len
char test[51];
const char *pos;

if (ext_len < 0 || ext_len >= 50) {
if (ext_len >= 50) {
return FAILURE;
}

if (executable == 1) {
/* copy "." as well */
memcpy(test, ext_str - 1, ext_len + 1);
test[ext_len + 1] = '\0';
strlcpy(test, ext_str, ext_len + 1);

/* executable phars must contain ".phar" as a valid extension (phar://.pharmy/oops is invalid) */
/* (phar://hi/there/.phar/oops is also invalid) */
pos = strstr(test, ".phar");
Expand Down
7 changes: 0 additions & 7 deletions ext/phar/phar_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -389,13 +389,6 @@ static void phar_postprocess_ru_web(char *fname, size_t fname_len, char **entry,
u[0] = '\0';
u_len = strlen(u + 1);
e_len -= u_len + 1;

if (e_len < 0) {
if (saveu) {
saveu[0] = '/';
}
return;
}
} while (1);
}
/* }}} */
Expand Down