summary refs log tree commit diff
path: root/nss
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2014-06-23 10:24:45 +0200
committerAndreas Schwab <schwab@suse.de>2014-06-23 12:29:51 +0200
commitac60763eac3d43b7234dd21286ad3ec3f17957fc (patch)
treeae02d85e705b69513ef85cd7f452b35c40f7d278 /nss
parentc5c13355132e73578bbc0c612ddff964e6199747 (diff)
downloadglibc-ac60763eac3d43b7234dd21286ad3ec3f17957fc.tar.gz
glibc-ac60763eac3d43b7234dd21286ad3ec3f17957fc.tar.xz
glibc-ac60763eac3d43b7234dd21286ad3ec3f17957fc.zip
Don't ignore too long lines in nss_files (BZ #17079)
Diffstat (limited to 'nss')
-rw-r--r--nss/nss_files/files-XXX.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nss/nss_files/files-XXX.c b/nss/nss_files/files-XXX.c
index 00b2ecf612..212b938fdf 100644
--- a/nss/nss_files/files-XXX.c
+++ b/nss/nss_files/files-XXX.c
@@ -198,10 +198,12 @@ get_contents (char *linebuf, size_t len, FILE *stream)
     {
       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;