Skip to content
Merged
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
3 changes: 2 additions & 1 deletion main/safe_bcmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <string.h>

/*
* Returns 0 if both inputs match, 1 if they don't.
* Returns 0 if both inputs match, non-zero if they don't.
* Returns -1 early if inputs do not have the same lengths.
*
*/
Expand All @@ -34,6 +34,7 @@ PHPAPI int php_safe_bcmp(const zend_string *a, const zend_string *b)
return -1;
}

/* This is security sensitive code. Do not optimize this for speed. */
while (i < ZSTR_LEN(a)) {
r |= ua[i] ^ ub[i];
++i;
Expand Down