Bug 9823 - Error in psignal(int sig, const char * s) if s is an empty string
Summary: Error in psignal(int sig, const char * s) if s is an empty string
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.8
: P2 normal
Target Milestone: ---
Assignee: Ulrich Drepper
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-06 15:13 UTC by Alexey Khoroshilov
Modified: 2014-07-01 20:57 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Khoroshilov 2009-02-06 15:13:44 UTC
/* Print out on stderr a line consisting of the test in S, a colon, a space,
   a message describing the meaning of the signal number SIG and a newline.
   If S is NULL or "", the colon and space are omitted.  */
void
psignal (int sig, const char *s)
{
  const char *colon, *desc;

- if (s == NULL || s == '\0')
+ if (s == NULL || *s == '\0')
    s = colon = "";
  else
    colon = ": ";

There is a misprint in the code above (libc/stdio-common/psignal.c).
Comment 1 Ulrich Drepper 2009-02-06 16:04:31 UTC
Fixed in cvs.