Bug 137379 - argus-2.0.6-5: local variable used before set
Summary: argus-2.0.6-5: local variable used before set
Status: RESOLVED FIXED
Alias: None
Product: SUSE LINUX 10.0
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: unspecified
Hardware: All Other
: P5 - None : Minor
Target Milestone: ---
Assignee: Michal Marek
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-07 14:46 UTC by David Binderman
Modified: 2006-01-03 13:25 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2005-12-07 14:46:12 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.
Comment 1 Michal Marek 2006-01-03 13:25:13 UTC
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.