Comment 3 for bug 1066056

Revision history for this message
Scott Pakin (pakin) wrote :

Aha! These gtkmorph crashes have been annoying me for years, but I never made the connection to filename length until I encountered this bug report. I believe that was just the information I needed to fix the problem. From what I can tell, the bug lies in the show_fs() function in gtkmorph/callbacks_fs.c, which hard-wires 50 characters for a file name. The 70+ characters in the bug report is a bit of a red herring; that's probably just the point where the buffer overrun tickles some critical data structure and brings down the whole application.

The solution is to replace

    char s[l+50];

with

    char s[l+strlen(N)+1];

I've attached a patch file. Could the morph package maintainer please test and apply it?