From 48e792cc951a9d00fad0691ef7411c9e22cf675a Mon Sep 17 00:00:00 2001 From: "Neal H. Walfield" Date: Fri, 21 Aug 2015 09:32:58 +0200 Subject: [PATCH] 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 . --- g10/parse-packet.c | 8 ++++---- 1 file 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*/