~ubuntu-branches/ubuntu/trusty/bash/trusty-security

« back to all changes in this revision

Viewing changes to debian/patches/bash42-011.diff

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-03-03 22:52:05 UTC
  • mfrom: (1.3.5) (2.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20140303225205-87ltrt5kspeq0g1b
Tags: 4.3-1ubuntu1
* Merge with Debian; remaining changes:
  - skel.bashrc:
    - Run lesspipe.
    - Enable ls aliases.
    - Set options in ll alias to -alF.
    - Define an alert alias.
    - Enabled colored grep aliases.
  - etc.bash.bashrc:
    - Add sudo hint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
                             BASH PATCH REPORT
2
 
                             =================
3
 
 
4
 
Bash-Release:   4.2
5
 
Patch-ID:       bash42-011
6
 
 
7
 
Bug-Reported-by:        "David Parks" <davidparks21@yahoo.com>
8
 
Bug-Reference-ID:       <014101cc82c6$46ac1540$d4043fc0$@com>
9
 
Bug-Reference-URL:      http://lists.gnu.org/archive/html/bug-bash/2011-10/msg00031.html
10
 
 
11
 
Bug-Description:
12
 
 
13
 
Overwriting a value in an associative array causes the memory allocated to
14
 
store the key on the second and subsequent assignments to leak.
15
 
 
16
 
Patch (apply with `patch -p0'):
17
 
 
18
 
--- a/bash/assoc.c
19
 
+++ b/bash/assoc.c
20
 
@@ -77,6 +77,11 @@
21
 
   b = hash_search (key, hash, HASH_CREATE);
22
 
   if (b == 0)
23
 
     return -1;
24
 
+  /* If we are overwriting an existing element's value, we're not going to
25
 
+     use the key.  Nothing in the array assignment code path frees the key
26
 
+     string, so we can free it here to avoid a memory leak. */
27
 
+  if (b->key != key)
28
 
+    free (key);
29
 
   FREE (b->data);
30
 
   b->data = value ? savestring (value) : (char *)0;
31
 
   return (0);
32
 
--- a/bash/patchlevel.h
33
 
+++ b/bash/patchlevel.h
34
 
@@ -25,6 +25,6 @@
35
 
    regexp `^#define[   ]*PATCHLEVEL', since that's what support/mkversion.sh
36
 
    looks for to find the patch level (for the sccs version string). */
37
 
 
38
 
-#define PATCHLEVEL 10
39
 
+#define PATCHLEVEL 11
40
 
 
41
 
 #endif /* _PATCHLEVEL_H_ */