<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Invalid pointer from COFFObjectFile::getLoadConfig32()"
href="https://bugs.llvm.org/show_bug.cgi?id=34108">34108</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Invalid pointer from COFFObjectFile::getLoadConfig32()
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>w.parker.thompson@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>When trying to access the load config of a COFF file, the getter functions
getLoadConfig32 / getLoadConfig64 will return a uninitialized pointer
(COFFObjectFile::LoadConfig). During parsing in
COFFObjectFile::initLoadConfigPtr this pointer will remain uninitialized if
there is a failure to parse this directory. For example if the directory
exists but it does not have a valid size / vaddr.
If this pointer defaulted to nullptr then it could be checked by the caller.
Currently a caller needs to manually confirm that a load_config directory
exists and that its vaddr does not equal 0x0.
I have an example binary that expresses this but unfortunately is too large to
attach. I can provide it if needed.
Output from python's pefile module when run against the testcase:
<snip>
[IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG]
0x1A0 0x0 VirtualAddress: 0x0
0x1A4 0x4 Size: 0x0
<snip></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>