Banned C standard library functions in Git source code
21–30 of 329 posts
Re: Banned C standard library functions in Git source code
#22That's a surprisingly small list, missing e.g. sscanf / gets / strtok / all the other "usual suspects" at least
Re: Banned C standard library functions in Git source code
#23Why is there no brief explanations in this code why each function is banned?
Re: Banned C standard library functions in Git source code
#24Why is there no brief explanations in this code why each function is banned?
Re: Banned C standard library functions in Git source code
#25Why is there no brief explanations in this code why each function is banned?
Re: Banned C standard library functions in Git source code
#26I'm just kidding by the way. For those C programmers who haven't encountered these before, it is a powerful way to do a "goto" in C. Powerful in the sense that you can jump anywhere, not limited to the same function. If it's used at all these days, it's used for exception handling.
More info: https://en.wikipedia.org/wiki/Setjmp.h
Re: Banned C standard library functions in Git source code
#27Looks like Git has its own string type: https://github.com/git/git/blob/master/strbuf.h https://github.com/git/git/blob/master/strbuf.c See this for the story of why strncpy/strncat are insecure: https://en.wikipedia.org/wiki/C_string_handling#Replacements
Re: Banned C standard library functions in Git source code
#28I guess they care too much about portability to use "pragma GCC poison"?
Wanting code to compile on something other than gcc is not "caring too much", it's being responsible
Re: Banned C standard library functions in Git source code
#29Why is there no brief explanations in this code why each function is banned?
https://pointerless.wordpress.com/2012/02/26/strcpy-security...
Re: Banned C standard library functions in Git source code
#30For anybody else: Why is strncpy insecure? https://stackoverflow.com/questions/869883/why-is-strncpy-in... > strncpy() doesn't require NUL termination, and is therefore susceptible to a variety of exploits.