mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-02-20 00:10:09 -05:00
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:
parent
7508da9360
commit
9ce73696b0
1 changed files with 3 additions and 0 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Reference in a new issue