chiark / gitweb /
Disable all exported shell functions
[bash.git] / debian / patches / bash42-024.diff
1                              BASH PATCH REPORT
2                              =================
3
4 Bash-Release:   4.2
5 Patch-ID:       bash42-024
6
7 Bug-Reported-by:        Jim Avera <james_avera@yahoo.com>
8 Bug-Reference-ID:       <4F29E07A.80405@yahoo.com>
9 Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2012-02/msg00001.html
10
11 Bug-Description:
12
13 When `printf -v' is used to set an array element, the format string contains
14 `%b', and the corresponding argument is the empty string, the buffer used
15 to store the value to be assigned can be NULL, which results in NUL being
16 assigned to the array element.  This causes a seg fault when it's used later.
17
18 Index: b/bash/builtins/printf.def
19 ===================================================================
20 --- a/bash/builtins/printf.def
21 +++ b/bash/builtins/printf.def
22 @@ -255,6 +255,8 @@
23  #endif
24             {
25               vflag = 1;
26 +             if (vbsize == 0)
27 +               vbuf = xmalloc (vbsize = 16);
28               vblen = 0;
29               if (vbuf)
30                 vbuf[0] = 0;
31 Index: b/bash/patchlevel.h
32 ===================================================================
33 --- a/bash/patchlevel.h
34 +++ b/bash/patchlevel.h
35 @@ -25,6 +25,6 @@
36     regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
37     looks for to find the patch level (for the sccs version string). */
38  
39 -#define PATCHLEVEL 23
40 +#define PATCHLEVEL 24
41  
42  #endif /* _PATCHLEVEL_H_ */