Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#2 Segmentation Fault do to improper copy

open
nobody
None
5
2009-12-30
2009-12-30
Anonymous
No

When copying filename it uses a static char array to store it. It is recommended to use heap. But that's not the real problem. You should use strncpy to safe copy the string. That saves you from stack overflow problems because it lets you specify the amount of chars to be copied. If you pass it more than that, it will only copy that amount and disregard the rest. I'm uploading a patch. I've not really tried it since I have dependency problems to recompile, sorry. But I think you won't have any problem with it.

Discussion

  •  
    Attachments