kov changed libgksu/branches/libgksu2/ChangeLog, libgksu/branches/libgksu2/libgksu/libgksu.c

Gustavo Noronha kov at costa.debian.org
Sun Apr 16 16:11:19 UTC 2006


Mensagem de log: 
more debug code not buffer overflowing with suggestion
of Beno?\195?\174t Dejean <benoit at placenet.org>


-----


Modified: libgksu/branches/libgksu2/ChangeLog
===================================================================
--- libgksu/branches/libgksu2/ChangeLog	2006-04-16 16:08:44 UTC (rev 547)
+++ libgksu/branches/libgksu2/ChangeLog	2006-04-16 16:11:14 UTC (rev 548)
@@ -1,6 +1,10 @@
 2006-04-16  Gustavo Noronha Silva  <kov at debian.org>
 
-	* libgksu/gksu-context.c:
+	* libgksu/libgksu.c:
+	- used suggestion by Benoît Dejean <benoit at placenet.org>
+	  to avoid buffer overflows on the debug code
+
+	* libgksu/libgksu.c:
 	- patch from Michael Vogt to fix corner condition which
 	  happens when fgets returns badly with a specific app
 

Modified: libgksu/branches/libgksu2/libgksu/libgksu.c
===================================================================
--- libgksu/branches/libgksu2/libgksu/libgksu.c	2006-04-16 16:08:44 UTC (rev 547)
+++ libgksu/branches/libgksu2/libgksu/libgksu.c	2006-04-16 16:11:14 UTC (rev 548)
@@ -767,7 +767,7 @@
   int in, out;
   int r;
   char *newfn;
-  char buf[BUFSIZ];
+  char buf[BUFSIZ] = "";
 
   newfn = g_strdup_printf("%s/.Xauthority", dir);
 
@@ -1257,7 +1257,7 @@
 	  struct termios tio;
 
 	  usleep (100);
-	  read (fdpty, buf, 256);
+	  read (fdpty, buf, 255);
 	  if (context->debug)
 	    fprintf (stderr, "gksu_context_run: buf: -%s-\n", buf);
 
@@ -1313,7 +1313,7 @@
 	  /* drop the \n echoed on password entry if su did request
 	     a password */
 	  if (password_needed)
-	    read (fdpty, buf, 256);
+	    read (fdpty, buf, 255);
 	  if (context->debug)
 	    fprintf (stderr, "DEBUG (run:post-after-pass) buf: -%s-\n", buf);
 	  read (fdpty, buf, 255);
@@ -1359,7 +1359,7 @@
 	  tcdrain (fdpty);
 
 	  bzero (buf, 256);
-	  read (fdpty, buf, 256);
+	  read (fdpty, buf, 255);
 	}
       else
 	{




More information about the gksu-commits mailing list