Actions
Bug #1670
closedModbus compiler warnings on Fedora 23
Affected Versions:
Effort:
Difficulty:
Label:
Description
When compiling 3.0RC3 from source on Fedora 23 -
[root@localhost suricata-3.0RC3]# uname -a Linux localhost.localdomain 4.2.7-300.fc23.x86_64 #1 SMP Wed Dec 9 22:28:30 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
the following warnings are present about modbus:
CC app-layer-modbus.o
app-layer-modbus.c: In function ‘ModbusParseWriteRequest’:
app-layer-modbus.c:736:31: warning: ‘byte’ may be used uninitialized in this function [-Wmaybe-uninitialized]
tx->data[i] = (uint16_t) byte;
^
app-layer-modbus.c: In function ‘ModbusParseResponse’:
app-layer-modbus.c:614:24: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
(count != (2 * (tx->read.quantity))))
^
app-layer-modbus.c:599:13: note: ‘count’ was declared here
uint8_t count;
^
app-layer-modbus.c:1164:24: warning: ‘mei’ may be used uninitialized in this function [-Wmaybe-uninitialized]
if (mei != tx->mei)
^
app-layer-modbus.c:1121:49: note: ‘mei’ was declared here
uint8_t count, error = FALSE, function, mei;
^
app-layer-modbus.c:1156:21: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ModbusCheckHeaderLength(modbus, tx->length, 2 + count);
^
app-layer-modbus.c:1121:17: note: ‘count’ was declared here
uint8_t count, error = FALSE, function, mei;
^
app-layer-modbus.c:499:5: warning: ‘exception’ may be used uninitialized in this function [-Wmaybe-uninitialized]
switch (exception) {
^
app-layer-modbus.c:493:13: note: ‘exception’ was declared here
uint8_t exception;
^
app-layer-modbus.c:1138:13: warning: ‘function’ may be used uninitialized in this function [-Wmaybe-uninitialized]
switch(function) {
^
app-layer-modbus.c:1121:39: note: ‘function’ was declared here
uint8_t count, error = FALSE, function, mei;
^
app-layer-modbus.c: In function ‘ModbusParseRequest’:
app-layer-modbus.c:1040:13: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
ModbusCheckHeaderLength(modbus, tx->length, 2 + count);
^
app-layer-modbus.c:964:17: note: ‘count’ was declared here
uint8_t count;
^
Actions