summaryrefslogtreecommitdiffstats
path: root/kbx
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2001-12-15 17:19:08 +0100
committerWerner Koch <wk@gnupg.org>2001-12-15 17:19:08 +0100
commitf82bdf6e940c34f1533ee158b9e72f1dfdd2ba90 (patch)
tree3f5646c49babf32a32f7c38f5c81ba2f482f76f9 /kbx
parent* decrypt.c (gpgsm_decrypt): Write STATUS_DECRYPTION_*. (diff)
downloadgnupg2-f82bdf6e940c34f1533ee158b9e72f1dfdd2ba90.tar.xz
gnupg2-f82bdf6e940c34f1533ee158b9e72f1dfdd2ba90.zip
* keybox-search.c (blob_cmp_name): There is no terminating 0 stored
for the uid; fixed length compare.
Diffstat (limited to 'kbx')
-rw-r--r--kbx/ChangeLog5
-rw-r--r--kbx/keybox-search.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/kbx/ChangeLog b/kbx/ChangeLog
index 7c4047f95..e1a2bb734 100644
--- a/kbx/ChangeLog
+++ b/kbx/ChangeLog
@@ -1,3 +1,8 @@
+2001-12-15 Werner Koch <wk@gnupg.org>
+
+ * keybox-search.c (blob_cmp_name): There is no terminating 0 stored
+ for the uid; fixed length compare.
+
2001-12-14 Werner Koch <wk@gnupg.org>
* keybox-blob.c (x509_email_kludge): New.
diff --git a/kbx/keybox-search.c b/kbx/keybox-search.c
index 376bc23ae..41fb83233 100644
--- a/kbx/keybox-search.c
+++ b/kbx/keybox-search.c
@@ -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);
}