diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | nss/nss_files/files-netgrp.c | 3 |
2 files changed, 6 insertions, 1 deletions
@@ -1,5 +1,9 @@ 2014-01-27 Siddhesh Poyarekar <siddhesh@redhat.com> + [BZ #16506] + * nss/nss_files/files-netgrp.c (_nss_files_setnetgrent): Avoid + access beyond array bounds when parsing netgroups file. + * nscd/netgroupcache.c (addgetnetgrentX): Compute offset from the old buffer before realloc. diff --git a/nss/nss_files/files-netgrp.c b/nss/nss_files/files-netgrp.c index 339f704c93..34eae4c5be 100644 --- a/nss/nss_files/files-netgrp.c +++ b/nss/nss_files/files-netgrp.c @@ -103,7 +103,8 @@ _nss_files_setnetgrent (const char *group, struct __netgrent *result) result->cursor += (curlen - group_len) - 1; } - while (line[curlen - 1] == '\n' && line[curlen - 2] == '\\') + while (curlen > 1 && line[curlen - 1] == '\n' + && line[curlen - 2] == '\\') { /* Yes, we have a continuation line. */ if (found) |