From 26308b39472021f7a782478ac50f9ea3f3e5a9d0 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Tue, 10 Nov 2015 08:49:34 +0000 Subject: [PATCH] Improved handling of potential program error with -msg_op read_sieve. Coverity CID 28723. --- xorriso/text_io.c | 15 ++++++++++----- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/xorriso/text_io.c b/xorriso/text_io.c index 4b747f45..079d3c58 100644 --- a/xorriso/text_io.c +++ b/xorriso/text_io.c @@ -1954,8 +1954,7 @@ int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name, } if(f->next_to_deliver == NULL) { /* Should not happen */ - *available= 0; - break; + goto unexpected_null; } if(f->num_words <= 0) return(1); @@ -1974,9 +1973,15 @@ int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name, if((*argv)[i] == NULL) goto no_mem; } else { - - /* >>> ??? should not happen */; - + /* should not happen */ +unexpected_null:; + Xorriso_msgs_submit(xorriso, 0, + "Program error: Unexpected NULL pointer in message sieve.", + 0, "WARNING", 0); + if(*argv != NULL) + Xorriso__dispose_words(argc, argv); + *available= 0; + return(-2); } lst= Xorriso_lst_get_next(lst, 0); } diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 5d729eaa..c1372512 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2015.11.09.133135" +#define Xorriso_timestamP "2015.11.10.084903"