From e50097d233cb52551702165324514cb6018a7627 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 10 Jun 2009 14:16:40 -0700 Subject: Fix glibc 2.7 strtok_r() bug in a more permanent fashion. The glibc 2.7 headers contain a bug that causes strtok_r() to segfault in some circumstances. Until now, we have been working around this problem at each invocation, but this depends on the programmer to remember to do so each time. This commit instead adds a shim that adds a work-around to the string.h header itself, so that it is much more difficult to miss the workaround. --- lib/vconn-ssl.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'lib/vconn-ssl.c') diff --git a/lib/vconn-ssl.c b/lib/vconn-ssl.c index 20bfb979..96890e6b 100644 --- a/lib/vconn-ssl.c +++ b/lib/vconn-ssl.c @@ -279,12 +279,8 @@ ssl_open(const char *name, char *suffix, struct vconn **vconnp) return retval; } - /* Glibc 2.7 has a bug in strtok_r when compiling with optimization that - * can cause segfaults here: - * http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614. - * Using "::" instead of the obvious ":" works around it. */ - host_name = strtok_r(suffix, "::", &save_ptr); - port_string = strtok_r(NULL, "::", &save_ptr); + host_name = strtok_r(suffix, ":", &save_ptr); + port_string = strtok_r(NULL, ":", &save_ptr); if (!host_name) { ovs_error(0, "%s: bad peer name format", name); return EAFNOSUPPORT; -- cgit v1.2.3