3 ms·
Patch fixing the bug: https://www.gitorious.org/gnutls/gnutls/commit/855127da290a280df839038671ae6aba01957736 https://www.gitorious.org/gnutls/gnutls/commit/85
by kenferry 13y ago
Patch fixing the bug:
https://www.gitorious.org/gnutls/gnutls/commit/855127da290a280df839038671ae6aba01957736 https://www.gitorious.org/gnutls/gnutls/commit/855127da290a2...
Basically, the code said
bool isOk() {
result = someCheckReturningNegativeOnFailure()
if (result < 0) goto cleanup;
cleanup:
...
return result;
}
The issue is that failure is communicated with a negative number in one case and 0 in another, and the wires got crossed.
- QSIITurbo 13y agoYeah. While they're at it, why not change every function to return "int". Then just cast to proper type at usage. /s (And no, bool is not the proper way to go either.) But seriously, I'm amazed that code this critical uses sloppy typing. I mean, they might as well use Python ffs. Maybe it's historical burden?