On Friday, March 11, 2011 01:23:12 PM Patrick Baggett wrote: > I feel like there is some kind of underlying lesson that we, OpenGL app > programmers, should be getting out of this...
Yes. Don't blindly copy abitrary amounts of data into a fixed size buffer. :) I hate to be trite, but that -is- the entire problem: a classic buffer overflow, the kind we warn people about in early programming courses. As Ian pointed out, it's absolutely trivial to do this correctly: if you're going to copy it, just malloc a buffer that's the correct size. In particular, glGetString says nothing about the length of the returned string, so you can't safely assume that it will fit in -any- fixed size buffer. > What about a psuedo-database of app -> extension list rather than by year? > Surely Quake3 doesn't make use of but <= 10 extensions. I'd imagine the > same holds true for other old games as well. A simple "strings" on their > binary could figure that out... Brian is right here. We already have two very simple solutions...let's stick with one of those. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev