[Bf-blender-cvs] [5efa7fa] master: Fix possible harmful warning: the value of the size argument in 'strncat' is too large, change the argument to be the free space in the destination buffer minus the terminating null byte

Jens Verwiebe noreply at git.blender.org
Tue Aug 5 12:03:47 CEST 2014


Commit: 5efa7fa534c343a50e2fc62d76de171cd808bae2
Author: Jens Verwiebe
Date:   Tue Aug 5 12:03:31 2014 +0200
Branches: master
https://developer.blender.org/rB5efa7fa534c343a50e2fc62d76de171cd808bae2

Fix possible harmful warning: the value of the size argument in 'strncat' is too large, change the argument to be the free space in the destination buffer minus the terminating null byte

===================================================================

M	extern/cuew/src/cuew.c

===================================================================

diff --git a/extern/cuew/src/cuew.c b/extern/cuew/src/cuew.c
index 9ba65ac..da892ef 100644
--- a/extern/cuew/src/cuew.c
+++ b/extern/cuew/src/cuew.c
@@ -686,7 +686,7 @@ int cuewCompilerVersion(void) {
 
   while (!feof(pipe)) {
     if (fgets(buf, sizeof(buf), pipe) != NULL) {
-      strncat(output, buf, sizeof(output) - strlen(output));
+      strncat(output, buf, sizeof(output) - strlen(output) - 1 );
     }
   }




More information about the Bf-blender-cvs mailing list