freebsd-ports/mail/sympa/files/patch-src-queue.c
Pav Lucistnik 75838a2fb7 - Fix security vulnerability (buffer overflow)
- Fix fetching
- Switch UID of sympa user from 1025 to 200, >1000 UIDs should be really
  reserved for regular interactive users [1]

		[1]
PR:		ports/77367
Submitted by:	Scott Balmos <scott.balmos@utoledo.edu>
Approved by:	maintainer timeout (2 weeks)
2005-02-27 13:55:24 +00:00

42 lines
1.4 KiB
C

===================================================================
RCS file: /var/www/SourceSup/cvs/sympa/sympa/src/queue.c,v
retrieving revision 1.4
retrieving revision 1.4.2.1
diff -u -r1.4 -r1.4.2.1
--- src/queue.c 2003/10/07 12:04:47 1.4
+++ src/queue.c 2005/01/27 08:54:02 1.4.2.1
@@ -1,5 +1,5 @@
/* queue.c - This program does the messages spooling
- RCS Identication ; $Revision: 1.4 $ ; $Date: 2003/10/07 12:04:47 $
+ RCS Identication ; $Revision: 1.4.2.1 $ ; $Date: 2005/01/27 08:54:02 $
Sympa - SYsteme de Multi-Postage Automatique
Copyright (c) 1997, 1998, 1999, 2000, 2001 Comite Reseau des Universites
@@ -26,12 +26,17 @@
#include <string.h>
#include <stdlib.h>
-static char rcsid[] = "(@)$Id: queue.c,v 1.4 2003/10/07 12:04:47 salaun Exp $";
+static char rcsid[] = "(@)$Id: queue.c,v 1.4.2.1 2005/01/27 08:54:02 sympa-authors Exp $";
static char qfile[128];
static char buf[16384];
static int i, fd;
+/* For HP-UX */
+#ifndef EX_CONFIG
+# define EX_CONFIG 78
+#endif
+
#ifndef CONFIG
# define CONFIG "/etc/sympa.conf"
#endif
@@ -116,7 +121,7 @@
exit(EX_NOPERM);
}
umask(027);
- sprintf(qfile, "T.%s.%ld.%d", listname, time(NULL), getpid());
+ snprintf(qfile, sizeof(qfile), "T.%s.%ld.%d", listname, time(NULL), getpid());
fd = open(qfile, O_CREAT|O_WRONLY, 0600);
if (fd == -1){
char* buffer=(char*)malloc(strlen(argv[0])+strlen(queuedir)+80);