summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStepan Broz <sbroz@redhat.com>2019-07-25 11:00:47 +0200
committerPanu Matilainen <pmatilai@redhat.com>2020-03-26 11:57:58 +0200
commit0efe6d7cb59a2413d58e018bd7fe14cadbd29fb6 (patch)
tree867f5d06a0d15a09a96e875fbb69182233def266
parentdc80038cf7a48eb90848c75857e4ea1c88e174c5 (diff)
downloadrpm-0efe6d7cb59a2413d58e018bd7fe14cadbd29fb6.tar.gz
rpmpgp: Handle EOF without EOL better at END PGP
(cherry picked from commit 655c4c72a3467037abd51aab29f0300e97caf54c) (cherry picked from commit 8ac9af9d0a63c935e7eb7436f6d69fded7f7eb2b)
-rw-r--r--rpmio/rpmpgp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index 061751a4d..46cd0f31a 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -1289,9 +1289,10 @@ static pgpArmor decodePkts(uint8_t *b, uint8_t **pkt, size_t *pktlen)
goto exit;
}
t += (sizeof("-----")-1);
- if (t >= te) continue;
+ /* Handle EOF without EOL here, *t == '\0' at EOF */
+ if (*t && (t >= te)) continue;
/* XXX permitting \r here is not RFC-2440 compliant <shrug> */
- if (!(*t == '\n' || *t == '\r')) continue;
+ if (!(*t == '\n' || *t == '\r' || *t == '\0')) continue;
crcdec = NULL;
crclen = 0;