This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Error-handling bug in setstate()


>Submitter-Id:	net
>Originator:	Michael Fischer
>Organization:
  ==================================================
  | Michael Fischer <fischer-michael@cs.yale.edu>  |
  | Professor of Computer Science                  |
  ==================================================
>
>Confidential:	no
>Synopsis:	setstate() fails to set errno on buf == NULL error
>Severity:	non-critical
>Priority:	low
>Category:	libc
>Class:		sw-bug
>Release:	libc-2.1.3
>Environment:
Host type: i386-redhat-linux-gnu
System: Linux daphne.home 2.2.16 #14 Sun Jun 18 23:14:21 EDT 2000 i686 unknown
Architecture: i686

Addons: c_stubs crypt glibc-compat linuxthreads
Build CFLAGS: -g -O3
Build CC: egcs
Compiler version: egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Kernel headers: 2.2.16
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio

>Description:
setstate() fails to set errno on buf == NULL error and instead goes
straight to "fail".
>How-To-Repeat:
N/A
>Fix:
Change lines 214-215 from
  if (buf == NULL)
    goto fail;
to
  if (buf == NULL) {
    __set_errno (EINVAL);
    goto fail;
  }

Note: My previous bug report also mentions line 214, suggesting that
the test "buf == NULL" be replaced with "buf == NULL || arg_state ==
NULL".  I believe both changes should be made.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]