Sisyphus repositório
Última atualização: 20 setembro 2019 | SRPMs: 17455 | Visitas: 15130068
en ru br
ALT Linux repositórios
S:3.0.12-alt8
5.0: 1.3.36-alt2
4.1: 1.3.31-alt2
4.0: 1.3.31-alt1
3.0: 1.3.24-alt2

Group :: Desenvolvimento/C
RPM: swig

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs e FR  Repocop 

Patch: upstream-issue-898.patch
Download


From 9825fcbab5c4ddd867432f9922bebfbec7b78af0 Mon Sep 17 00:00:00 2001
From: Mark Dufour <m.dufour@kopano.com>
Date: Tue, 14 Feb 2017 10:34:37 +0100
Subject: [PATCH] [Coverity] fix issue reported for SWIG_Python_FixMethods
Fix Coverity issue reported for SWIG_Python_FixMethods:
"buffer_size: Calling strncpy with a source string whose length
(10 chars) is greater than or equal to the size argument (10)
will fail to null-terminate buff."
The issue is only reported for the "swig_ptr: " line, but for
consistency we replace both occurrences of strncpy with memcpy.
---
 Lib/python/pyinit.swg | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/python/pyinit.swg b/Lib/python/pyinit.swg
index 2cc5828411..fe45ac941f 100644
--- a/Lib/python/pyinit.swg
+++ b/Lib/python/pyinit.swg
@@ -306,9 +306,9 @@ SWIG_Python_FixMethods(PyMethodDef *methods,
 	  char *ndoc = (char*)malloc(ldoc + lptr + 10);
 	  if (ndoc) {
 	    char *buff = ndoc;
-	    strncpy(buff, methods[i].ml_doc, ldoc);
+	    memcpy(buff, methods[i].ml_doc, ldoc);
 	    buff += ldoc;
-	    strncpy(buff, "swig_ptr: ", 10);
+	    memcpy(buff, "swig_ptr: ", 10);
 	    buff += 10;
 	    SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
 	    methods[i].ml_doc = ndoc;
 
projeto & código: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
mantenedor atual: Michael Shigorin
mantenedor da tradução: Fernando Martini aka fmartini © 2009