Skip to content

Commit 9951492

Browse files
committed
utils: Check for NULL guess in datum_secure_strequals (and always fail)
1 parent 01732b6 commit 9951492

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/datum_utils.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -736,6 +736,7 @@ int datum_atoi_strict(const char * const s, const size_t size) {
736736
}
737737

738738
bool datum_secure_strequals(const char *secret, size_t secret_len, const char *guess) {
739+
if (!guess) return false;
739740
const size_t guess_len = strlen(guess);
740741
size_t acc = secret_len ^ guess_len;
741742
if (!secret_len) {

0 commit comments

Comments
 (0)