From 98a7a16eadd7c062881c5629dc20b7483c576d51 Mon Sep 17 00:00:00 2001
From: gabrielC <couturier.gabriel@gmail.com>
Date: Thu, 11 May 2017 11:51:09 +0200
Subject: [PATCH] bug fixes from Fujitsu (bug 21)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Note: this fix does not solve the issue with how
this buffer is used in this function, but I'm not
sure this code is used at all (Cédric Roux).

----------------------------------------------------------
bug 21

Ttile:
PAYLOAD_MAX=1500, so this coding results in index overflow.
Additionally, operator "!=" just compairs something, this
coding is meaningless.

Bug Location:
buffer[PAYLOAD_MAX] != '\0';

Note:
Detected by CppCheck
----------------------------------------------------------
---
 openair2/UTIL/OTG/otg_rx_socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openair2/UTIL/OTG/otg_rx_socket.c b/openair2/UTIL/OTG/otg_rx_socket.c
index 2caeee4f527..98e03532a15 100644
--- a/openair2/UTIL/OTG/otg_rx_socket.c
+++ b/openair2/UTIL/OTG/otg_rx_socket.c
@@ -98,7 +98,7 @@ void *recv_ip4_tcp(void* csock)
 
 
       LOG_I(OTG,"SOCKET:: TCP-IP4 :: size=%d  received=%d, Received buffer: %s   \n\n\n", strlen(buffer),  sock_rcv, buffer);
-      buffer[PAYLOAD_MAX] != '\0';
+      //buffer[PAYLOAD_MAX] != '\0';
 
     }
 
-- 
GitLab