Bug 3748 - Usage of `__libc_once' interface in `sysdeps/posix/getaddrinfo.c'
Summary: Usage of `__libc_once' interface in `sysdeps/posix/getaddrinfo.c'
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.4
: P2 normal
Target Milestone: ---
Assignee: Roland McGrath
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-18 14:51 UTC by Thomas Schwinge
Modified: 2016-05-08 14:01 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments
Proposed patch. (1.59 KB, patch)
2006-12-18 14:52 UTC, Thomas Schwinge
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Schwinge 2006-12-18 14:51:33 UTC
`sysdeps/posix/getaddrinfo.c' contains the following code:

#v+
  2033        /* Read the config file.  */
  2034        __libc_once_define (static, once);
  2035        __typeof (once) old_once = once;
  2036        __libc_once (once, gaiconf_init);
  2037        if (old_once && gaiconf_reload_flag)
  2038          gaiconf_reload ();
#v-

In the `if' statement it is assumed that `old_once' is a scalar value, which
need not be, and that it is zero-initialized by default, which need not be
either, although unlikely.


I will attach a patch with a proposal to fix this issue.
Comment 1 Thomas Schwinge 2006-12-18 14:52:12 UTC
Created attachment 1465 [details]
Proposed patch.
Comment 2 Ulrich Drepper 2006-12-18 15:11:18 UTC
old_once is scalar and is zero initialized.  Who do you think you are to decide
that this is not the case?
Comment 3 Thomas Schwinge 2012-05-11 03:09:25 UTC
be971a2b1c7828d94c41edd5cd22c1d9dcef1b6e