diff options
author | Neal H. Walfield <neal@g10code.com> | 2015-08-21 09:32:58 +0200 |
---|---|---|
committer | Neal H. Walfield <neal@g10code.com> | 2015-08-21 14:20:54 +0200 |
commit | 48e792cc951a9d00fad0691ef7411c9e22cf675a (patch) | |
tree | d034f9cc11351a0365c0a201659f48acf6bf8afb /g10/parse-packet.c | |
parent | common: Better respect the packet's length when reading it. (diff) | |
download | gnupg2-48e792cc951a9d00fad0691ef7411c9e22cf675a.tar.xz gnupg2-48e792cc951a9d00fad0691ef7411c9e22cf675a.zip |
common: Don't continuing processing on error.
* g10/parse-packet.c (dbg_parse_packet): Also return if parse returns
an error.
(parse_packet): Likewise.
(dbg_search_packet): Likewise.
(search_packet): Likewise.
--
Signed-off-by: Neal H. Walfield <neal@g10code.com>.
Diffstat (limited to '')
-rw-r--r-- | g10/parse-packet.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/g10/parse-packet.c b/g10/parse-packet.c index 2afba5469..4ba941972 100644 --- a/g10/parse-packet.c +++ b/g10/parse-packet.c @@ -272,7 +272,7 @@ dbg_parse_packet (IOBUF inp, PACKET *pkt, const char *dbg_f, int dbg_l) { rc = parse (inp, pkt, 0, NULL, &skip, NULL, 0, "parse", dbg_f, dbg_l); } - while (skip); + while (skip && ! rc); return rc; } #else /*!DEBUG_PARSE_PACKET*/ @@ -285,7 +285,7 @@ parse_packet (IOBUF inp, PACKET * pkt) { rc = parse (inp, pkt, 0, NULL, &skip, NULL, 0); } - while (skip); + while (skip && ! rc); return rc; } #endif /*!DEBUG_PARSE_PACKET*/ @@ -308,7 +308,7 @@ dbg_search_packet (IOBUF inp, PACKET * pkt, off_t * retpos, int with_uid, parse (inp, pkt, with_uid ? 2 : 1, retpos, &skip, NULL, 0, "search", dbg_f, dbg_l); } - while (skip); + while (skip && ! rc); return rc; } #else /*!DEBUG_PARSE_PACKET*/ @@ -321,7 +321,7 @@ search_packet (IOBUF inp, PACKET * pkt, off_t * retpos, int with_uid) { rc = parse (inp, pkt, with_uid ? 2 : 1, retpos, &skip, NULL, 0); } - while (skip); + while (skip && ! rc); return rc; } #endif /*!DEBUG_PARSE_PACKET*/ |