Description of problem:
with usage of strsep() function an entire program ends with
Version-Release number of selected component (if applicable):
Compile and run the program given by the URL
Steps to Reproduce:
1. get the source from the URL
all from above but without "Segmentation fault"
kernel-2.6.7-1.494.2.2 and gcc-3.3.3-7 was used to compile the test
CPU AMD AthlonXP 2200+, MB Epox with nForce2-Ultra chipset, 2 DIMMs at
Ah, yes - if strsep() finds no any of the separators provided in the
working buffer, it doesn't produces "Segmentation fault"
Your testcase is wrong.
The segfault is not in strsep, but when trying to free(buf).
As you used buf as strtok_r's *ptrptr pointer (and data as strsep's *stringp
pointer), the buf you pass to free is what malloc gave you plus
8 (length of the test string) and data will be NULL at the end.
You probably want to change dataptr from char ** to char * and pass
&dataptr to strtok_r and strsep.