1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

* keybox-search.c (blob_cmp_name): There is no terminating 0 stored

for the uid; fixed length compare.
This commit is contained in:
Werner Koch 2001-12-15 16:19:08 +00:00
parent 1301c0b5ef
commit f82bdf6e94
2 changed files with 7 additions and 3 deletions

View file

@ -170,9 +170,8 @@ blob_cmp_name (KEYBOXBLOB blob, int idx, const char *name, size_t namelen)
len = get32 (buffer+pos+4);
if (off+len > length)
return 0; /* out of bounds */
if (len < 2)
return 0; /* empty name or 0 not stored */
len--;
if (len < 1)
return 0; /* empty name */
return len == namelen && !memcmp (buffer+off, name, len);
}