[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] stupidity, and a lesson learned



spotter . wrote:
Hi everybody,

I just got hit by the silliest, stupidest error on my part and I
decided to share it, since it was kinda funny after the fact and so
that no one else would make my mistake.

[snip]

I was thinking that the .strip() simply took out the specified absolute phrase. I was wrong. The .strip() looks for all the characters specified and takes them out. For the other tags, this did not get me since none of the other names matched any where close to data type or the combination of letters. Only for the author part because I had put in pumaninja which if you see has p, u, m, a contained in mapauthor.
Happened to me too.
Was once trying to change an extension from .rbs to .mp3,
and just did 'filename.strip('.rbs')'.
Yeah, it sucks.
Note that the way your mapfile is formatted, you could just import it as a python module, and the variables would be declared automatically.
As long as you can trust people not to mess with your mapfiles.
Considering they could just change the source of your actual program if they wanted to be malicious, I don't really see this as a security vulnerability.
But... to each his own, I guess.
-Luke