summaryrefslogtreecommitdiffstats
path: root/common/tlv-parser.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2024-07-23 13:54:15 +0200
committerWerner Koch <wk@gnupg.org>2024-07-23 13:54:15 +0200
commitea123af9b57fe865efc035bd828dd3a187cb0f02 (patch)
tree0b461ece6cfee13695f6126813b1e8c302dea230 /common/tlv-parser.c
parentg13: Finish migration to gpgrt_process_spawn API (diff)
downloadgnupg2-ea123af9b57fe865efc035bd828dd3a187cb0f02.tar.xz
gnupg2-ea123af9b57fe865efc035bd828dd3a187cb0f02.zip
Revert "common: Fix tlv-parser for constructed OCTET-STRING."
-- This reverts commit cc78b26a4729db2280334214e21a8847e95d2ab0.
Diffstat (limited to '')
-rw-r--r--common/tlv-parser.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/common/tlv-parser.c b/common/tlv-parser.c
index bc22c4f4f..2cafac3e9 100644
--- a/common/tlv-parser.c
+++ b/common/tlv-parser.c
@@ -556,10 +556,7 @@ tlv_expect_octet_string (tlv_parser_t tlv, int encapsulates,
&& (!tlv->ti.is_constructed || encapsulates)))
return (tlv->lasterr = gpg_error (GPG_ERR_INV_OBJ));
p = tlv->buffer;
- n = tlv->ti.length;
- if (!n && tlv->ti.ndef)
- n = tlv->bufsize;
- else if (!tlv->ti.length)
+ if (!(n=tlv->ti.length) && !tlv->ti.ndef)
return (tlv->lasterr = gpg_error (GPG_ERR_TOO_SHORT));
if (encapsulates && tlv->ti.is_constructed