branch Attitude Adjustment packages
[12.09/packages.git] / utils / bash / patches / 122-upstream-bash42-022.patch
1                              BASH PATCH REPORT
2                              =================
3
4 Bash-Release:   4.2
5 Patch-ID:       bash42-022
6
7 Bug-Reported-by:        Gregory Margo <gmargo@pacbell.net>
8 Bug-Reference-ID:       <20110727174529.GA3333@pacbell.net>
9 Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2011-07/msg00102.html
10
11 Bug-Description:
12
13 The return value from lseek is `off_t'.  This can cause corrupted return
14 values when the file offset is greater than 2**31 - 1.
15
16 Patch (apply with `patch -p0'):
17
18 --- a/lib/sh/zread.c
19 +++ b/lib/sh/zread.c
20 @@ -160,14 +160,13 @@ void
21  zsyncfd (fd)
22       int fd;
23  {
24 -  off_t off;
25 -  int r;
26 +  off_t off, r;
27  
28    off = lused - lind;
29    r = 0;
30    if (off > 0)
31      r = lseek (fd, -off, SEEK_CUR);
32  
33 -  if (r >= 0)
34 +  if (r != -1)
35      lused = lind = 0;
36  }
37 --- a/patchlevel.h
38 +++ b/patchlevel.h
39 @@ -25,6 +25,6 @@
40     regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
41     looks for to find the patch level (for the sccs version string). */
42  
43 -#define PATCHLEVEL 21
44 +#define PATCHLEVEL 22
45  
46  #endif /* _PATCHLEVEL_H_ */