Ticket #4901: 4901.dpatch

File 4901.dpatch, 1.4 KB (added by batterseapower, 2 years ago)
Line 
11 patch for repository darcs.haskell.org:/srv/darcs/ghc:
2
3Fri Apr  1 14:11:20 BST 2011  Max Bolingbroke <batterseapower@hotmail.com>
4  * Do not trust the BSD archive-supplied symbol length. Fixes #4901
5
6New patches:
7
8[Do not trust the BSD archive-supplied symbol length. Fixes #4901
9Max Bolingbroke <batterseapower@hotmail.com>**20110401131120
10 Ignore-this: 3a7aed46b05219ea8a66044c7120c12
11] hunk ./rts/Linker.c 1775
12                          path);
13                 }
14                 fileName[thisFileNameSize] = 0;
15+
16+                // In theory, the file name size we get from the large-filename field
17+                // should be exactly as long as the actual filename. However, in practice
18+                // we often see archives that only use some of the allocated space for
19+                // the filename.
20+                //
21+                // It is important that we get the right size here, because we use it below
22+                // to index into the filename and determine if it is an object file (#4901).
23+                thisFileNameSize = strlen(fileName);
24             }
25             else {
26                 barf("loadArchive: BSD-variant filename size not found while reading filename from `%s'", path);
27
28Context:
29
30[TAG git migration
31Ian Lynagh <igloo@earth.li>**20110331134846
32 Ignore-this: 5572f46dda57e62defcb124c3a80069a
33]
34Patch bundle hash:
3519a3fd47185e9be9974cf22c2f388330f8229118