gcc address sanitizer detected a read after the end of string in
sqlite3_sharedprefix_fn. Make sure to stop comparing the strings when
seeing the zero terminator.
Signed-off-by: Mark Wielaard <mark@klomp.org>
const unsigned char* a = sqlite3_value_text (argv[0]);
const unsigned char* b = sqlite3_value_text (argv[1]);
int i = 0;
- while (*a++ == *b++)
+ while (*a != '\0' && *b != '\0' && *a++ == *b++)
i++;
sqlite3_result_int (c, i);
}