]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix range error handling in sgetspent.
authorAndreas Schwab <schwab@redhat.com>
Wed, 2 Feb 2011 13:59:04 +0000 (08:59 -0500)
committerPetr Baudis <pasky@suse.cz>
Thu, 3 Feb 2011 23:02:35 +0000 (00:02 +0100)
(cherry picked from commit 10a656fe33d8257531ff3e9a882d3fd7db6ce5b3)

ChangeLog
shadow/sgetspent.c

index b4dcd7f0e4d0d9be4bc208c472b29947a058bd83..6f3a19b118c4aad4155467d68350ea093fd0a992 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-02  Andreas Schwab  <schwab@redhat.com>
+
+       * shadow/sgetspent.c: Check return value of __sgetspent_r instead
+       of errno.
+
 2010-10-01  Andreas Schwab  <schwab@redhat.com>
 
        * sysdeps/posix/getaddrinfo.c (gaih_inet): Don't discard result of
index ec7f384fa65bb97aa47509344f5cb7bfe8111b05..f3dce53ea3051297762643afc99ce04a0fb2bf04 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 2011 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -49,8 +49,8 @@ sgetspent (const char *string)
     }
 
   while (buffer != NULL
-        && __sgetspent_r (string, &resbuf, buffer, buffer_size, &result) != 0
-        && errno == ERANGE)
+        && (__sgetspent_r (string, &resbuf, buffer, buffer_size, &result)
+            == ERANGE))
     {
       char *new_buf;
       buffer_size += BUFLEN_SPWD;