diff options
| author | Spenser Reinhardt <sreinhardt@nagios.com> | 2014-06-05 22:43:07 -0500 |
|---|---|---|
| committer | Jan Wagner <waja@cyconet.org> | 2014-06-28 18:16:59 +0200 |
| commit | 9ce73696b0407b43bcd96269fb1fd6c343834475 (patch) | |
| tree | 1174515915721530528ed30f3bd89bc10621b60a /plugins | |
| parent | 7508da9360a77c6799e74a8109b768a1b8fbba11 (diff) | |
| download | monitoring-plugins-9ce7369.tar.gz | |
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.
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_apt.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/check_apt.c b/plugins/check_apt.c index 4c76a512..07622c2f 100644 --- a/plugins/check_apt.c +++ b/plugins/check_apt.c | |||
| @@ -223,6 +223,9 @@ int run_upgrade(int *pkgcount, int *secpkgcount){ | |||
| 223 | regex_t ireg, ereg, sreg; | 223 | regex_t ireg, ereg, sreg; |
| 224 | char *cmdline=NULL, rerrbuf[64]; | 224 | char *cmdline=NULL, rerrbuf[64]; |
| 225 | 225 | ||
| 226 | /* initialize ereg as it is possible it is printed while uninitialized */ | ||
| 227 | memset(&ereg, "\0", sizeof(ereg.buffer)); | ||
| 228 | |||
| 226 | if(upgrade==NO_UPGRADE) return STATE_OK; | 229 | if(upgrade==NO_UPGRADE) return STATE_OK; |
| 227 | 230 | ||
| 228 | /* compile the regexps */ | 231 | /* compile the regexps */ |
