openbsd-ports/editors/xemacs21/patches/patch-lib-src_movemail_c
brad e296bee697 Max Vozeler discovered a format string vulnerability in the "movemail"
utility of Emacs. By sending specially crafted packets, a malicious
POP3 server could cause a buffer overflow, which could have been
exploited to execute arbitrary code with the privileges of the user.
2005-02-09 03:48:43 +00:00

29 lines
921 B
Plaintext

$OpenBSD: patch-lib-src_movemail_c,v 1.2 2005/02/09 03:48:43 brad Exp $
--- lib-src/movemail.c.orig Tue Aug 20 07:34:22 2002
+++ lib-src/movemail.c Tue Feb 8 20:42:15 2005
@@ -588,14 +588,12 @@ lock_dot(char *filename)
p--;
*p = 0;
strcpy (p, "EXXXXXX");
- mktemp (tempname);
- unlink (tempname);
for (;;)
{
/* Create the lock file, but not under the lock file name. */
/* Give up if cannot do that. */
- desc = open (tempname, O_WRONLY | O_CREAT | O_EXCL, 0666);
+ desc = mkstemp (tempname);
if (desc < 0)
{
char *message = (char *) xmalloc (strlen (tempname) + 50);
@@ -796,7 +794,7 @@ popmail (char *user, char *outfile, char
mbx_delimit_begin (mbf);
if (pop_retr (server, i, mbx_write, mbf) != POP_RETRIEVED)
{
- error (Errmsg, NULL, NULL);
+ error ("%s", Errmsg, NULL);
close (mbfi);
return (1);
}