[Commits] jpilot.c 1.18.2.33 1.18.2.34 mutt.c 1.6.10.19 1.6.10.20 pine.c 1.6.2.18 1.6.2.19 procmsg.c 1.150.2.120 1.150.2.121 vcard.c 1.14.2.21 1.14.2.22

pawel at claws-mail.org pawel at claws-mail.org
Wed Feb 1 19:26:57 CET 2012


Update of /home/claws-mail/claws/src
In directory srv:/tmp/cvs-serv3932/src

Modified Files:
      Tag: gtk2
	jpilot.c mutt.c pine.c procmsg.c vcard.c 
Log Message:
2012-02-01 [pawel]	3.8.0cvs20

	* src/jpilot.c
	* src/mutt.c
	* src/pine.c
	* src/procmsg.c
	* src/vcard.c
	* src/gtk/sslcertwindow.c
		More strncat boundary checks

Index: mutt.c
===================================================================
RCS file: /home/claws-mail/claws/src/mutt.c,v
retrieving revision 1.6.10.19
retrieving revision 1.6.10.20
diff -u -d -r1.6.10.19 -r1.6.10.20
--- mutt.c	17 Oct 2011 11:02:44 -0000	1.6.10.19
+++ mutt.c	1 Feb 2012 18:26:54 -0000	1.6.10.20
@@ -533,7 +533,7 @@
 */
 gchar *mutt_find_file( void ) {
 	const gchar *homedir;
-	gchar str[ WORK_BUFLEN ];
+	gchar str[ WORK_BUFLEN + 1 ];
 	gint len;
 	FILE *fp;
 
@@ -548,7 +548,7 @@
 			str[ ++len ] = '\0';
 		}
 	}
-	strncat( str, MUTT_HOME_FILE, WORK_BUFLEN );
+	strncat( str, MUTT_HOME_FILE, WORK_BUFLEN - strlen(str) );
 
 	/* Attempt to open */
 	if( ( fp = g_fopen( str, "rb" ) ) != NULL ) {

Index: jpilot.c
===================================================================
RCS file: /home/claws-mail/claws/src/jpilot.c,v
retrieving revision 1.18.2.33
retrieving revision 1.18.2.34
diff -u -d -r1.18.2.33 -r1.18.2.34
--- jpilot.c	17 Oct 2011 11:02:44 -0000	1.18.2.33
+++ jpilot.c	1 Feb 2012 18:26:54 -0000	1.18.2.34
@@ -1595,7 +1595,7 @@
  */
 gchar *jpilot_find_pilotdb( void ) {
 	const gchar *homedir;
-	gchar str[ WORK_BUFLEN ];
+	gchar str[ WORK_BUFLEN + 1 ];
 	gint len;
 	FILE *fp;
 
@@ -1610,9 +1610,9 @@
 			str[ ++len ] = '\0';
 		}
 	}
-	strncat( str, JPILOT_DBHOME_DIR, WORK_BUFLEN );
-	strncat( str, G_DIR_SEPARATOR_S, WORK_BUFLEN );
-	strncat( str, JPILOT_DBHOME_FILE, WORK_BUFLEN );
+	strncat( str, JPILOT_DBHOME_DIR, WORK_BUFLEN - strlen(str) );
+	strncat( str, G_DIR_SEPARATOR_S, WORK_BUFLEN - strlen(str) );
+	strncat( str, JPILOT_DBHOME_FILE, WORK_BUFLEN - strlen(str) );
 
 	/* Attempt to open */
 	if( ( fp = g_fopen( str, "rb" ) ) != NULL ) {

Index: pine.c
===================================================================
RCS file: /home/claws-mail/claws/src/pine.c,v
retrieving revision 1.6.2.18
retrieving revision 1.6.2.19
diff -u -d -r1.6.2.18 -r1.6.2.19
--- pine.c	17 Oct 2011 11:02:44 -0000	1.6.2.18
+++ pine.c	1 Feb 2012 18:26:54 -0000	1.6.2.19
@@ -635,7 +635,7 @@
  */
 gchar *pine_find_file( void ) {
 	const gchar *homedir;
-	gchar str[ WORK_BUFLEN ];
+	gchar str[ WORK_BUFLEN + 1 ];
 	gint len;
 	FILE *fp;
 
@@ -650,7 +650,7 @@
 			str[ ++len ] = '\0';
 		}
 	}
-	strncat( str, PINE_HOME_FILE, WORK_BUFLEN );
+	strncat( str, PINE_HOME_FILE, WORK_BUFLEN - strlen(str) );
 
 	/* Attempt to open */
 	if( ( fp = g_fopen( str, "rb" ) ) != NULL ) {

Index: vcard.c
===================================================================
RCS file: /home/claws-mail/claws/src/vcard.c,v
retrieving revision 1.14.2.21
retrieving revision 1.14.2.22
diff -u -d -r1.14.2.21 -r1.14.2.22
--- vcard.c	17 Oct 2011 11:02:44 -0000	1.14.2.21
+++ vcard.c	1 Feb 2012 18:26:54 -0000	1.14.2.22
@@ -561,7 +561,7 @@
 gchar *vcard_find_gnomecard( void ) {
 	const gchar *homedir;
 	gchar buf[ WORK_BUFLEN ];
-	gchar str[ WORK_BUFLEN ];
+	gchar str[ WORK_BUFLEN + 1 ];
 	gchar *fileSpec;
 	gint len, lenlbl, i;
 	FILE *fp;
@@ -577,9 +577,9 @@
 			str[ ++len ] = '\0';
 		}
 	}
-	strncat( str, GNOMECARD_DIR, WORK_BUFLEN );
-	strncat( str, G_DIR_SEPARATOR_S, WORK_BUFLEN );
-	strncat( str, GNOMECARD_FILE, WORK_BUFLEN );
+	strncat( str, GNOMECARD_DIR, WORK_BUFLEN - strlen(str) );
+	strncat( str, G_DIR_SEPARATOR_S, WORK_BUFLEN - strlen(str) );
+	strncat( str, GNOMECARD_FILE, WORK_BUFLEN - strlen(str) );
 
 	fileSpec = NULL;
 	if( ( fp = g_fopen( str, "rb" ) ) != NULL ) {

Index: procmsg.c
===================================================================
RCS file: /home/claws-mail/claws/src/procmsg.c,v
retrieving revision 1.150.2.120
retrieving revision 1.150.2.121
diff -u -d -r1.150.2.120 -r1.150.2.121
--- procmsg.c	16 Dec 2011 13:30:33 -0000	1.150.2.120
+++ procmsg.c	1 Feb 2012 18:26:54 -0000	1.150.2.121
@@ -1147,7 +1147,8 @@
 	g_free(prtmp);
 
 	g_strchomp(buf);
-	if (buf[strlen(buf) - 1] != '&') strncat(buf, "&", sizeof(buf));
+	if (buf[strlen(buf) - 1] != '&')
+		strncat(buf, "&", sizeof(buf) - strlen(buf) - 1);
 	if (system(buf) == -1)
 		g_warning("system(%s) failed.", buf);
 }



More information about the Commits mailing list