-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] Conditional jump or move depends on uninitialised value(s) #1284
Comments
void phalcon_get_uri(zval *return_value, zval *path) {
int i, found = 0, mark = 0;
char *cursor, *str, ch;
if (Z_TYPE_P(path) != IS_STRING) {
RETURN_EMPTY_STRING();
}
if (Z_STRLEN_P(path) > 0) {
cursor = Z_STRVAL_P(path) + Z_STRLEN_P(path) - 1;
for (i = Z_STRLEN_P(path); i >= 0; i--) {
ch = *cursor;
if (ch == '/' || ch == '\\') {
found++;
if (found == 1) {
mark = i - 1;
} else {
str = emalloc(mark - i + 1);
memcpy(str, Z_STRVAL_P(path) + i, mark - i);
str[mark - i] = '\0';
ZVAL_STRINGL(return_value, str, mark - i, 0);
return;
}
}
cursor--;
}
}
RETURN_EMPTY_STRING();
} When |
|
ghost
closed this as completed
Sep 24, 2013
This issue was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
None yet
0 participants
Happens both in 1.2.4 and 1.3.0
The text was updated successfully, but these errors were encountered: