[Openvas-commits] r2690 - in branches/openvas-libraries-1-0: . libopenvas

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 6 15:17:27 CET 2009


Author: mwiegand
Date: 2009-03-06 15:17:25 +0100 (Fri, 06 Mar 2009)
New Revision: 2690

Modified:
   branches/openvas-libraries-1-0/ChangeLog
   branches/openvas-libraries-1-0/libopenvas/proctitle.c
Log:
* libopenvas/proctitle.c: Added commented RATS ignores where correct
allocation and termination is ensured.


Modified: branches/openvas-libraries-1-0/ChangeLog
===================================================================
--- branches/openvas-libraries-1-0/ChangeLog	2009-03-06 12:13:19 UTC (rev 2689)
+++ branches/openvas-libraries-1-0/ChangeLog	2009-03-06 14:17:25 UTC (rev 2690)
@@ -1,3 +1,8 @@
+2009-03-06  Michael Wiegand <michael.wiegand at intevation.de>
+
+	* libopenvas/proctitle.c: Added commented RATS ignores where correct
+	allocation and termination is ensured.
+
 2009-03-04  Vlatko Kosturjak <kost at linux.hr>
 
 	* libopenvas/bpf_share.c: by default, put pcap device in non

Modified: branches/openvas-libraries-1-0/libopenvas/proctitle.c
===================================================================
--- branches/openvas-libraries-1-0/libopenvas/proctitle.c	2009-03-06 12:13:19 UTC (rev 2689)
+++ branches/openvas-libraries-1-0/libopenvas/proctitle.c	2009-03-06 14:17:25 UTC (rev 2690)
@@ -33,7 +33,7 @@
 	environ = (char **) emalloc((sizeof (char *) * (i + 1))+envpsize+1);
 	s = ((char *)environ)+((sizeof (char *) * (i + 1)));
 	for (i = 0; envp[i] != NULL; i++){
-		strcpy(s,envp[i]); /* Flawfinder: ignore */ 
+		strcpy(s,envp[i]); /* RATS: ignore, s and environ are allocated accordingly */ 
 		environ[i] = s;
 		s += strlen(s)+1;
 	}
@@ -90,7 +90,7 @@
 
     snprintf(buf2, sizeof(buf2), "openvasd: %s", buf);
     bzero(buf, sizeof(buf));
-    strncpy(buf, buf2, sizeof(buf) - 1);
+    strncpy(buf, buf2, sizeof(buf) - 1); /* RATS: ignore, bzero above ensures nul-termination of buf */
    
     i = strlen(buf);
 
@@ -100,7 +100,7 @@
 		i = LastArgv - Argv[0] - 2;
 		buf[i] = '\0';
 	}
-	(void) strcpy(Argv[0], buf);
+	(void) strcpy(Argv[0], buf); /* RATS: ignore, buf is already truncated accordingly. */
 	{ char *p;
 	p = &Argv[0][i];
 	while (p < LastArgv)



More information about the Openvas-commits mailing list