[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gettext] [bug #47847] Undefined behavior [use-after-free] possible

From: Bruno Haible
Subject: [bug-gettext] [bug #47847] Undefined behavior [use-after-free] possible in libgettext
Date: Mon, 9 May 2016 07:14:09 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0

Follow-up Comment #2, bug #47847 (project gettext):

IMO the sentence "The value of a pointer becomes indeterminate when
the object it points to reaches the end of its lifetime." (ISO C 6.2.4) means
that you should not compare pointers to local variables which have gone out of
scope: The function

int foo (int x)
  int *pa, *pb;
  { int a = x; pa = &a; }
  { int b = x; pb = &b; }
  return pa == pb;

can return 0 or 1, depending on compiler optimizations. This explains the
coverity warning.


Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]