! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Segmentation Fault: 0xb782dbc7 in strchr () from /lib/tls/i686/cmov/libc.so.6
Status:
RESOLVED: FIXED

Comments

Description Cody A.W. Somerville 2008-12-20 18:22:55 CET
A segmentation fault occurs, using svn revision 6335, when you pass a string in the connect dialog with service type Custom Location that does not contain the substring "://".

#0  0xb782dbc7 in strchr () from /lib/tls/i686/cmov/libc.so.6
#1  0x0805226a in sion_bookmark_new_from_uri (name=0x0, uri=0x83bf940 "moo") at ../src/bookmark.c:138
#2  0x0805250f in sion_bookmark_set_uri (bookmark=0x84e7b80, uri=0x83bf940 "moo") at ../src/bookmark.c:314
#3  0x080562da in update_bookmark (dialog=0x8366528) at ../src/bookmarkeditdialog.c:532
...

In the code below, you use strstr to attempt to get a pointer to the beginning of the first occurrence of "://" in the string containing the uri supplied by the user but fail to check to see if the substring is actually found. You then increment the pointer by 3 before making a call to strchr, passing your null/invalid pointer, resulting in a segmentation fault.

src/bookmark.c, Lines 134 to138:
	s = strstr(uri, "://");
	s += 3;

	/* find end of host/port, this is the first slash after the initial double slashes */
	end = strchr(s, '/');
...
Comment 1 Enrico Tröger editbugs 2008-12-21 00:47:58 CET
Thanks for reporting, fixed in SVN.

Bug #4730

Reported by:
Cody A.W. Somerville
Reported on: 2008-12-20
Last modified on: 2009-07-14

People

Assignee:
Enrico Tröger
CC List:
0 users

Version

Version:
unspecified

Attachments

Additional information