Merge pull request #2033 from dm0-/bugs-1394

This fixes coreos/bugs#1394.
This commit is contained in:
David Michael 2016-06-29 14:39:36 -07:00 committed by GitHub
commit 5dc9407b38
2 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,31 @@
--- gshadow/fgetsgent_r.c
+++ gshadow/fgetsgent_r.c
@@ -37,6 +37,7 @@
struct sgrp **result)
{
char *p;
+ int rc;
_IO_flockfile (stream);
do
@@ -64,11 +65,18 @@
} while (*p == '\0' || *p == '#' || /* Ignore empty and comment lines. */
/* Parse the line. If it is invalid, loop to
get the next line of the file to parse. */
- ! parse_line (buffer, (void *) resbuf, (void *) buffer, buflen,
- &errno));
+ !(rc = parse_line (buffer, (void *) resbuf,
+ (void *) buffer, buflen, &errno)));
_IO_funlockfile (stream);
+ if (rc < 0)
+ {
+ *result = NULL;
+ __set_errno (ERANGE);
+ return errno;
+ }
+
*result = resbuf;
return 0;
}

View File

@ -160,6 +160,9 @@ eblit-src_unpack-pre() {
eblit-src_prepare-post() {
cd "${S}"
einfo "Patching to avoid segfaults on long /etc/gshadow lines"
epatch "${FILESDIR}"/2.23/glibc-2.23-gshadow-handle-erange.patch
if use hardened ; then
einfo "Patching to get working PIE binaries on PIE (hardened) platforms"
gcc-specs-pie && epatch "${FILESDIR}"/2.17/glibc-2.17-hardened-pie.patch