enip: fix scan-build warnings

detect-cipservice.c:161:29: warning: Assigned value is garbage or undefined
    cipserviced->cipservice = input[0];
                            ^ ~~~~~~~~
detect-cipservice.c:162:27: warning: Assigned value is garbage or undefined
    cipserviced->cipclass = input[1];
                          ^ ~~~~~~~~
detect-cipservice.c:163:31: warning: Assigned value is garbage or undefined
    cipserviced->cipattribute = input[2];
                              ^ ~~~~~~~~
3 warnings generated.
pull/2319/head
Victor Julien 9 years ago
parent 80c3aedbfc
commit 960ebb2822

@ -101,7 +101,7 @@ static DetectCipServiceData *DetectCipServiceParse(const char *rulestrc)
char* token;
char *save;
int var;
int input[3];
int input[3] = { 0, 0, 0 };
int i = 0;
token = strtok_r(rulestr, delims, &save);
@ -158,6 +158,11 @@ static DetectCipServiceData *DetectCipServiceParse(const char *rulestrc)
token = strtok_r(NULL, delims, &save);
}
if (i == 0) {
SCLogError(SC_ERR_INVALID_SIGNATURE, "no tokens found");
goto error;
}
cipserviced->cipservice = input[0];
cipserviced->cipclass = input[1];
cipserviced->cipattribute = input[2];

Loading…
Cancel
Save