[Gtkradiant] [Bug 1034] New: BufferedTextInputStream segfaults on powerpc

bugzilla-daemon at zerowing.idsoftware.com bugzilla-daemon at zerowing.idsoftware.com
Wed Oct 13 07:24:26 CDT 2004


           Summary: BufferedTextInputStream segfaults on powerpc
           Product: GtkRadiant
           Version: 1.5
          Platform: Macintosh
        OS/Version: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: editor
        AssignedTo: gtkradiant at zerowing.idsoftware.com
        ReportedBy: jaq at spacepants.org

After clicking the OK button when presented with the first dialog asking about
game type, radiant segfaults on line 295 of libs/textstream.h, "return *m_cur++;".

To cut a long story short, the fact that the compiler complains about casting a
negative value to a char is important: c_end shouldn't be negative on powerpc. 
I believe char defaults to unsigned here.   Attached is a patch which changes
c_end to 255, and prevents the segfault.

I believe that this is because any comparisons with c_end fail due to type errors.

This patch, of course, sucks, but it's the least intrusive option.  The best way
to fix this, IMHO, is a BufferedTextInputReader API that doesn't use magic
values to indicated end-of-stream, but I fear the depth that this class'
tentacles may have reached, given that an edit of this one file causes most of
the editor to be recompiled.

Configure bugmail: http://zerowing.idsoftware.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the Gtkradiant mailing list