This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug nptl/13724] New: pthread_setname_np segfault
- From: "law at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 22 Feb 2012 19:05:25 +0000
- Subject: [Bug nptl/13724] New: pthread_setname_np segfault
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13724
Bug #: 13724
Summary: pthread_setname_np segfault
Product: glibc
Version: 2.15
Status: NEW
Severity: normal
Priority: P2
Component: nptl
AssignedTo: unassigned@sourceware.org
ReportedBy: law@redhat.com
CC: drepper.fsp@gmail.com
Classification: Unclassified
pthread_setname_np can segfault if passed a NULL pointer.
#define _GNU_SOURCE
#include <pthread.h>
#include <stdio.h>
#include <string.h>
int
main(void)
{
pthread_t thr = pthread_self ();
int ret = pthread_setname_np (thr, NULL);
printf ("pthread_setname_np: %s\n", strerror (ret));
return 0;
}
The setname_np/getname_np have non-null attributes for the appropriate
arguments and one could make a case that this is ultimately a user error.
However, given these are not performance critical routines, I believe we can
spare the cycles to do argument verification to improve the quality of
implementation.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.