glibc/nss-files-long-lines.patch
Stephan Kulow c6e5fcd0d1 Accepting request 238382 from Base:System
- nss-files-long-lines.patch: Don't ignore too long lines in nss_files
  (bnc#883217, BZ #17079)
- Remove locale.1, localedef.1 and iconvconfig.8 manpages, now included in
  the man-pages package (bnc#880703)
- manpages.patch: update (forwarded request 238380 from Andreas_Schwab)

OBS-URL: https://build.opensuse.org/request/show/238382
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=175
2014-06-25 09:47:19 +00:00

25 lines
843 B
Diff

2014-06-23 Andreas Schwab <schwab@suse.de>
[BZ #17079]
* nss/nss_files/files-XXX.c (get_contents): Store overflow marker
before reading the next line.
Index: glibc-2.19/nss/nss_files/files-XXX.c
===================================================================
--- glibc-2.19.orig/nss/nss_files/files-XXX.c
+++ glibc-2.19/nss/nss_files/files-XXX.c
@@ -198,10 +198,12 @@ get_contents (char *linebuf, size_t len,
{
int curlen = ((remaining_len > (size_t) INT_MAX) ? INT_MAX
: remaining_len);
- char *p = fgets_unlocked (curbuf, curlen, stream);
+ /* Terminate the line so that we can test for overflow. */
((unsigned char *) curbuf)[curlen - 1] = 0xff;
+ char *p = fgets_unlocked (curbuf, curlen, stream);
+
/* EOF or read error. */
if (p == NULL)
return gcr_error;