Fix incorrect prefix comparison
Former-commit-id: 1ef167546be0678edd457d65a5368e8706fde0a3
This commit is contained in:
parent
0381e728ab
commit
bb3314c0d9
@ -3,13 +3,13 @@
|
||||
#include <sstream>
|
||||
#include <mutex>
|
||||
|
||||
static const char *keyprefix = INTERNAL_KEY_PREFIX;
|
||||
static const char keyprefix[] = INTERNAL_KEY_PREFIX;
|
||||
|
||||
bool FInternalKey(const char *key, size_t cch)
|
||||
{
|
||||
if (cch > strlen(INTERNAL_KEY_PREFIX))
|
||||
if (cch >= sizeof(INTERNAL_KEY_PREFIX))
|
||||
{
|
||||
if (memcmp(key, keyprefix, strlen(INTERNAL_KEY_PREFIX)) == 0)
|
||||
if (memcmp(key, keyprefix, sizeof(INTERNAL_KEY_PREFIX)-1) == 0)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user