diff options
author | Kirill Ponomarev <krion@FreeBSD.org> | 2004-05-11 07:36:58 +0000 |
---|---|---|
committer | Kirill Ponomarev <krion@FreeBSD.org> | 2004-05-11 07:36:58 +0000 |
commit | 60ae95d9528102197590f167370eae4408b71865 (patch) | |
tree | 726f8942b568cf60c6332512c9a7b001d828b80f /mail | |
parent | Update to version 0.2.2. (diff) |
- Fix the tmpfile patch to really include the right bounds for
snprintf() and strncat().
PR: ports/66508
Submitted by: maintainer
Diffstat (limited to 'mail')
-rw-r--r-- | mail/mutt-devel/files/patch-mktemp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mail/mutt-devel/files/patch-mktemp b/mail/mutt-devel/files/patch-mktemp index bb02ae52e2f7..8a3d717ba0d4 100644 --- a/mail/mutt-devel/files/patch-mktemp +++ b/mail/mutt-devel/files/patch-mktemp @@ -7,9 +7,9 @@ - snprintf (s, _POSIX_PATH_MAX, "%s/mutt-%s-%d-%d", NONULL (Tempdir), NONULL(Hostname), (int) getpid (), Counter++); + char t[7]; + snprintf (t, 7, "-%05d", Counter++); -+ snprintf (s, _POSIX_PATH_MAX-7, "%s/mutt-%s-XXXXXXXX", NONULL(Tempdir), NONULL(Hostname)); ++ snprintf (s, _POSIX_PATH_MAX-6, "%s/mutt-%s-XXXXXXXX", NONULL(Tempdir), NONULL(Hostname)); + mktemp (s); -+ strncat(s, t, _POSIX_PATH_MAX); ++ strncat(s, t, 6); dprint (1, (debugfile, "%s:%d: mutt_mktemp returns \"%s\".\n", src, line, s)); unlink (s); } |