{"push_id":693533168,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"c6ec6410afdb21cc6f2ecdf0d36559dc8f0fc6cd","before":"74ffe9bc78a898361bdcb3b97cb512bac338c62a","commits":[{"sha":"c6ec6410afdb21cc6f2ecdf0d36559dc8f0fc6cd","author":{"email":"b34e9dc3dd24827b45bb22e8b76cde1bcb413b0e@mit.edu","name":"Benjamin Kaduk"},"message":"Avoid unsafe scanf(\"%s\")\n\nReading user input into a fixed-length buffer just to check the\nfirst character is silly and an easy buffer overrun.  gcc on\nUbuntu 13.03 warns about the unchecked return value for scanf(),\nbut scanf(\"%s\") is guaranteed to either succeed or get EOF/EINTR/etc..\n\nIn any case, we don't need to use scanf() at all, here -- reuse an\nidiom from BSD cp(1) and loop around getchar to read the user's\nresponse, eliminating the fixed-length buffer entirely.  A separate\ninitial loop is needed to skip leading whitespace, which is done\nimplicitly by scanf().\n\nChange-Id: Ic5ed65e80146aa3d08a4b03c213f748ef088156b\nReviewed-on: http://gerrit.openafs.org/11758\nTested-by: BuildBot <buildbot@rampaginggeek.com>\nReviewed-by: Chas Williams <3chas3@gmail.com>\nReviewed-by: Benjamin Kaduk <kaduk@mit.edu>\nReviewed-by: Perry Ruiter <pruiter@sinenomine.net>\nReviewed-by: Michael Meffie <mmeffie@sinenomine.net>\nReviewed-by: Jeffrey Altman <jaltman@your-file-system.com>","distinct":true,"url":"https://api.github.com/repos/openafs/openafs/commits/c6ec6410afdb21cc6f2ecdf0d36559dc8f0fc6cd"}]}