Unity-Technologies / qstat

New official qstat repository
Artistic License 2.0
121 stars 33 forks source link

Many string command updates to help prevent buffer overflows. #72

Closed tdm4 closed 6 years ago

tdm4 commented 6 years ago

OK here's a pretty big pull request. I rewrote many of the strings functions to help prevent overflows. There are still some using the older functions that did pointer arithmetic that I didn't feel comfortable changing. I tested all the Quake 1 servers as mentioned in Issue #12 and none of them do a buffer overflow, however I think this will need quite a bit of testing.

tdm4 commented 6 years ago

Sorry, realized Linux doesn't have strlcpy or strlcat. I'll have to fix this up.

tdm4 commented 6 years ago

@stevenh - I did some of them for readability, but if there is a particular style you prefer, if you could give me an example I can revert the change back.

stevenh commented 6 years ago

For reference you can check formatting with uncrustify, not sure it will catch all the nits though.

stevenh commented 6 years ago

While this seemed like a good idea on closer review its adding lots of churn and introducing bugs, so I think we need to address individual issues as they are encountered. That and the lack of feedback I'm going to close this for now.