apphandler: Remove out of bounds array access
apphandler.C:188:24: warning: array subscript is above array bounds [-Warray-bounds]
tmp_array[3] = '\0';
^
Initalise tmp_array to zero, and avoid this bad access.
Signed-off-by: Joel Stanley <joel@jms.id.au>
diff --git a/apphandler.C b/apphandler.C
index d3df330..2c9ce6b 100644
--- a/apphandler.C
+++ b/apphandler.C
@@ -184,8 +184,7 @@
for(i = 0; i < tmp_size; i++)
{
- char tmp_array[3]; // Holder of the 2 chars that will become a byte
- tmp_array[3] = '\0';
+ char tmp_array[3] = {0}; // Holder of the 2 chars that will become a byte
strncpy(tmp_array, id_octet, 2); // 2 chars at a time
int resp_byte = strtoul(tmp_array, NULL, 16); // Convert to hex byte