• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/bash/bash44-009.patch
Peter KorsgaardPeter Korsgaard committed 54a9495123108 Feb 2017
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
From https://ftp.gnu.org/gnu/bash/bash-4.4-patches/bash44-009
2
​
3
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
4
​
5
                 BASH PATCH REPORT
6
                 =================
7
​
8
Bash-Release:   4.4
9
Patch-ID:   bash44-009
10
​
11
Bug-Reported-by:    Hong Cho <hong.cho@citrix.com>
12
Bug-Reference-ID:   <c30b5fe62b2543af8297e47ca487c29c@SJCPEX02CL02.citrite.net>
13
Bug-Reference-URL:  http://lists.gnu.org/archive/html/bug-bash/2016-12/msg00043.html
14
​
15
Bug-Description:
16
​
17
There is a race condition in add_history() that can be triggered by a fatal
18
signal arriving between the time the history length is updated and the time
19
the history list update is completed. A later attempt to reference an
20
invalid history entry can cause a crash.
21
​
22
Patch (apply with `patch -p0'):
23
​
24
*** bash-4.4-patched/lib/readline/history.c 2016-11-11 13:42:49.000000000 -0500
25
--- b/lib/readline/history.c    2016-12-05 10:37:51.000000000 -0500
26
***************
27
*** 280,283 ****
28
--- b/280,284 ----
29
  {
30
    HIST_ENTRY *temp;
31
+   int new_length;
32
  
33
    if (history_stifled && (history_length == history_max_entries))
34
***************
35
*** 296,306 ****
36
        /* Copy the rest of the entries, moving down one slot.  Copy includes
37
     trailing NULL.  */
38
- #if 0
39
-       for (i = 0; i < history_length; i++)
40
-   the_history[i] = the_history[i + 1];
41
- #else
42
        memmove (the_history, the_history + 1, history_length * sizeof (HIST_ENTRY *));
43
- #endif
44
  
45
        history_base++;
46
      }
47
--- b/297,303 ----
48
        /* Copy the rest of the entries, moving down one slot.  Copy includes
49
     trailing NULL.  */
50
        memmove (the_history, the_history + 1, history_length * sizeof (HIST_ENTRY *));
51
  
52
+       new_length = history_length;
53
        history_base++;
54
      }
55
***************
56
*** 316,320 ****
57
        history_size = DEFAULT_HISTORY_INITIAL_SIZE;
58
      the_history = (HIST_ENTRY **)xmalloc (history_size * sizeof (HIST_ENTRY *));
59
!     history_length = 1;
60
    }
61
        else
62
--- b/313,317 ----
63
        history_size = DEFAULT_HISTORY_INITIAL_SIZE;
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.