Github messages for voidlinux
 help / color / mirror / Atom feed
From: shahab-vahedi <shahab-vahedi@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] expect 5.45.4_3: Fix the buffer overlow while logging
Date: Tue, 01 Dec 2020 13:20:25 +0100	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26861@inbox.vuxu.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 1018 bytes --]

There is a new pull request by shahab-vahedi against master on the void-packages repository

https://github.com/shahab-vahedi/void-packages expect-fix
https://github.com/void-linux/void-packages/pull/26861

expect 5.45.4_3: Fix the buffer overlow while logging
There is a buffer overflow issue with "expect" when you run it
with "--debug" flag and the expected string is too big [1].

This patch was already proposed 7 years ago [2] but never found
its away upstream. Other distros also fix it locally [3]. It's
time we have it fixed in Void Linux as well.

[1] Bug 26986 - *** buffer overflow detected ***: expect terminated
https://sourceware.org/bugzilla/show_bug.cgi?id=26986

[2] Expect / Bugs / #95 buffer overflow in exp_log.c
https://sourceforge.net/p/expect/bugs/95/

[3] fedora fixing the overflow in expect
https://src.fedoraproject.org/rpms/expect/blob/master/f/expect-5.45-exp-log-buf-overflow.patch

A patch file from https://github.com/void-linux/void-packages/pull/26861.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-expect-fix-26861.patch --]
[-- Type: text/x-diff, Size: 2652 bytes --]

From 4cc9e9af87ec97308176a694e7b408820108e9ed Mon Sep 17 00:00:00 2001
From: Shahab Vahedi <shahab.vahedi@gmail.com>
Date: Tue, 1 Dec 2020 13:04:15 +0100
Subject: [PATCH] expect 5.45.4_3: Fix the buffer overlow while logging

There is a buffer overflow issue with "expect" when you run it
with "--debug" flag and the expected string is too big [1].

This patch was already proposed 7 years ago [2] but never found
its away upstream. Other distros also fix it locally [3]. It's
time we have it fixed in Void Linux as well.

[1] Bug 26986 - *** buffer overflow detected ***: expect terminated
https://sourceware.org/bugzilla/show_bug.cgi?id=26986

[2] Expect / Bugs / #95 buffer overflow in exp_log.c
https://sourceforge.net/p/expect/bugs/95/

[3] fedora fixing the overflow in expect
https://src.fedoraproject.org/rpms/expect/blob/master/f/expect-5.45-exp-log-buf-overflow.patch
---
 ...005-fix-buffer-overflow-when-logging.patch | 22 +++++++++++++++++++
 srcpkgs/expect/template                       |  2 +-
 2 files changed, 23 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/expect/patches/0005-fix-buffer-overflow-when-logging.patch

diff --git a/srcpkgs/expect/patches/0005-fix-buffer-overflow-when-logging.patch b/srcpkgs/expect/patches/0005-fix-buffer-overflow-when-logging.patch
new file mode 100644
index 00000000000..cc69ab474de
--- /dev/null
+++ b/srcpkgs/expect/patches/0005-fix-buffer-overflow-when-logging.patch
@@ -0,0 +1,22 @@
+*** exp_log.c	2020-12-01 12:09:21.839702061 +0100
+--- exp_log.c.patched	2020-12-01 12:09:43.075701160 +0100
+*************** expStdoutLog TCL_VARARGS_DEF(int,arg1)
+*** 179 ****
+!     (void) vsprintf(bigbuf,fmt,args);
+--- 179 ----
+!     (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args);
+*************** expErrorLog TCL_VARARGS_DEF(char *,arg1)
+*** 225 ****
+!     (void) vsprintf(bigbuf,fmt,args);
+--- 225 ----
+!     (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args);
+*************** expDiagLog TCL_VARARGS_DEF(char *,arg1)
+*** 267 ****
+!     (void) vsprintf(bigbuf,fmt,args);
+--- 267 ----
+!     (void) vsnprintf(bigbuf,sizeof(bigbuf),fmt,args);
+*************** expPrintf TCL_VARARGS_DEF(char *,arg1)
+*** 310 ****
+!   len = vsprintf(bigbuf,arg1,args);
+--- 310 ----
+!   len = vsnprintf(bigbuf,sizeof(bigbuf),arg1,args);
diff --git a/srcpkgs/expect/template b/srcpkgs/expect/template
index 664f91cdb40..2d0bdbd4e44 100644
--- a/srcpkgs/expect/template
+++ b/srcpkgs/expect/template
@@ -1,7 +1,7 @@
 # Template file for 'expect'
 pkgname=expect
 version=5.45.4
-revision=2
+revision=3
 wrksrc=${pkgname}${version}
 build_style=gnu-configure
 configure_args="expect_cv_wnohang_value=1"

             reply	other threads:[~2020-12-01 12:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 12:20 shahab-vahedi [this message]
2020-12-01 13:27 ` ericonr
2020-12-01 13:51 ` shahab-vahedi
2020-12-01 13:59 ` shahab-vahedi
2020-12-01 14:01 ` shahab-vahedi
2020-12-01 14:08 ` ericonr
2020-12-01 14:12 ` shahab-vahedi
2020-12-01 14:13 ` shahab-vahedi
2020-12-01 14:25 ` [PR PATCH] [Updated] " shahab-vahedi
2020-12-01 14:37 ` expect: " shahab-vahedi
2020-12-01 15:20 ` shahab-vahedi
2020-12-01 15:20 ` shahab-vahedi
2020-12-01 20:16 ` shahab-vahedi
2020-12-01 20:55 ` [PR PATCH] [Merged]: " ericonr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26861@inbox.vuxu.org \
    --to=shahab-vahedi@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).