Improved handling of potential program error with -msg_op read_sieve. Coverity CID 28723.

This commit is contained in:
Thomas Schmitt 2015-11-10 08:49:34 +00:00
parent 9a5cd3f4f0
commit e1c44a464a
2 changed files with 11 additions and 6 deletions

View File

@ -1954,8 +1954,7 @@ int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name,
} }
if(f->next_to_deliver == NULL) { if(f->next_to_deliver == NULL) {
/* Should not happen */ /* Should not happen */
*available= 0; goto unexpected_null;
break;
} }
if(f->num_words <= 0) if(f->num_words <= 0)
return(1); return(1);
@ -1974,9 +1973,15 @@ int Xorriso_sieve_get_result(struct XorrisO *xorriso, char *name,
if((*argv)[i] == NULL) if((*argv)[i] == NULL)
goto no_mem; goto no_mem;
} else { } 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); lst= Xorriso_lst_get_next(lst, 0);
} }

View File

@ -1 +1 @@
#define Xorriso_timestamP "2015.11.09.133135" #define Xorriso_timestamP "2015.11.10.084903"