Blob Blame History Raw
From b540c893d2afdadbcea93eb539ac5b3fa477528c Mon Sep 17 00:00:00 2001
From: Juan Jose Nicola <juan.nicola@greenbone.net>
Date: Tue, 12 Jun 2018 11:57:38 +0200
Subject: [PATCH] Fix Coverity issue #292084. Buffer not null terminated

---
 base/networking.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/base/openvas_networking.c b/base/openvas_networking.c
index 40394a6d..7cc91c2a 100644
--- a/base/openvas_networking.c
+++ b/base/openvas_networking.c
@@ -106,7 +106,7 @@ gvm_source_iface_init (const char *iface)
 
   /* At least one address for the interface was found. */
   if (ret == 0)
-    strncpy (global_source_iface, iface, sizeof (global_source_iface));
+    strncpy (global_source_iface, iface, sizeof (global_source_iface) - 1);
 
   freeifaddrs (ifaddr);
   return ret;