[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#134299: SEGV when using playmidi with 8-character filenames



I have been checking into the source of playmidi, and have determined
the cause of playmidi segfaulting on eight character filenames (on my
system) is found on line 422 of playmidi.c.

$ diff -c playmidi-2.4.orig/playmidi.c playmidi-2.4/playmidi.c
*** playmidi-2.4.orig/playmidi.c	Sun May 18 10:48:24 1997
--- playmidi-2.4/playmidi.c	Sun Feb 17 10:32:01 2002
***************
*** 439,445 ***
      for (i = optind; i < argc;) {
        filename = argv[i];
        if (stat(filename, &info) == -1) {
!           if ((extra = malloc(strlen(filename) + 4)) == NULL)
                close_show(-1);
            sprintf(extra, "%s.mid", filename);
            if (stat(extra, &info) == -1)
--- 439,445 ---
      for (i = optind; i < argc;) {
        filename = argv[i];
        if (stat(filename, &info) == -1) {
!           if ((extra = malloc(strlen(filename) + 5)) == NULL)
                close_show(-1);
            sprintf(extra, "%s.mid", filename);
            if (stat(extra, &info) == -1)

Seneca
seneca@slemish.com




Reply to: