unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 48c294f78ec0af69bf7933e4fadefa703e2b7cd9 891 bytes (raw)
name: gnu/packages/patches/tcsh-fix-out-of-bounds-read.patch 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
Fix out-of-bounds read in c_substitute():

http://seclists.org/oss-sec/2016/q4/612

Patch copied from upstream source repository:

https://github.com/tcsh-org/tcsh/commit/6a542dc4fb2ba26518a47e9b3a9bcd6a91b94596

From 6a542dc4fb2ba26518a47e9b3a9bcd6a91b94596 Mon Sep 17 00:00:00 2001
From: christos <christos>
Date: Fri, 2 Dec 2016 16:59:28 +0000
Subject: [PATCH] Fix out of bounds read (Brooks Davis) (reproduce by starting
 tcsh and hitting tab at the prompt)

---
 ed.chared.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ed.chared.c b/ed.chared.c
index 1277e53..310393e 100644
--- ed.chared.c
+++ ed.chared.c
@@ -750,7 +750,7 @@ c_substitute(void)
     /*
      * If we found a history character, go expand it.
      */
-    if (HIST != '\0' && *p == HIST)
+    if (p >= InputBuf && HIST != '\0' && *p == HIST)
 	nr_exp = c_excl(p);
     else
         nr_exp = 0;

debug log:

solving 48c294f78 ...
found 48c294f78 in https://git.savannah.gnu.org/cgit/guix.git

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).