plugins/check_apt.c - Print uninitialized ereg

Coverity 66531 - ereg.buffer can be printed without being initialized if do_include and do_exclude are null and critical is an invalid regex. While minor this may leak memory and cause undefined behavior.
This commit is contained in:
Spenser Reinhardt 2014-06-05 22:43:07 -05:00 committed by Jan Wagner
parent 7508da9360
commit 9ce73696b0

View file

@ -223,6 +223,9 @@ int run_upgrade(int *pkgcount, int *secpkgcount){
regex_t ireg, ereg, sreg;
char *cmdline=NULL, rerrbuf[64];
/* initialize ereg as it is possible it is printed while uninitialized */
memset(&ereg, "\0", sizeof(ereg.buffer));
if(upgrade==NO_UPGRADE) return STATE_OK;
/* compile the regexps */