<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On 5 February 2016 at 10:26, Jens Rehsack <span dir="ltr"><<a href="mailto:rehsack@gmail.com" target="_blank">rehsack@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":dap" class="a3s" style="overflow:hidden">+commit 3007f797a1a596e954f44879a5a7267966186ba4<br>
+Author: Mike Frysinger <<a href="mailto:vapier@gentoo.org">vapier@gentoo.org</a>><br>
+Date: Fri Aug 28 17:08:49 2015 -0400<br>
+<br>
+ getmntent: fix memory corruption w/blank lines [BZ #18887]<br>
+<br>
+ The fix for BZ #17273 introduced a single byte of memory corruption when<br>
+ the line is entirely blank. It would walk back past the start of the<br>
+ buffer if the heap happened to be 0x20 or 0x09 and then write a NUL byte.<br>
+ buffer = '\n';<br>
+ end_ptr = buffer;<br>
+ while (end_ptr[-1] == ' ' || end_ptr[-1] == '\t')<br>
+ end_ptr--;<br>
+ *end_ptr = '\0';<br>
+<br>
+ Fix that and rework the tests. Adding the testcase for BZ #17273 to the<br>
+ existing \040 parser does not really make sense as it's unrelated, and<br>
+ leads to confusing behavior: it implicitly relies on the new entry being<br>
+ longer than the previous entry (since it just rewinds the FILE*). Split<br>
+ it out into its own dedicated testcase instead.<br>
+<br>
+ (cherry picked from commit b0e805fa0d6fea33745952df7b7f5442ca4c374f)<br>
+<br></div></blockquote></div><br>This patch needs to have your Signed-off-by and Upstream-Status (Backport) tags in.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Ross</div></div>