Bugzilla – Bug 137379
argus-2.0.6-5: local variable used before set
Last modified: 2006-01-03 13:25:13 UTC
I just tried to compile package argus-2.0.6-5 with a prerelease of the GNU C compiler version 4.2. It said ./argus_filter.c:3993: warning: "protoid[4]" is used uninitialized in this function The source code is j = (pi[3] << 8) + pi[4]; Suggest code rework, around line 4270, function init_protoidarray. BTW, the email address of the author [argus@sei.cmu.edu ] seems to be broken.
To be honest, I can't figure out what the author ment here, but since the hash function lookup_protoid() is only called from one place (init_protoidarray()), it should be OK to do this: --- common/argus_filter.c +++ common/argus_filter.c @@ -4261,6 +4261,7 @@ protoid[0] = 0; protoid[1] = 0; protoid[2] = 0; + protoid[4] = 0; for (i = 0; i < ARGUS_MAXEPROTODB; i++) { if ((p = argus_eproto_db[i]) != NULL) { Update: argus_filter.c in the argus-clients package sets the array to zero as well, so this should be OK.