News for hackers. Stuff that matters.
Re:A brief history of one line fixes (2014) by thrdbndndn on Thursday June 23, 2022 @03:35AM (#31846152)
> I was fairly certain the sarcasm (or satire as I prefer to call it; sounds more intellectual) would be obvious.

I get that the author was being sarcastic, but I don't get what purpose they serve other than be obnoxious.

Re:A brief history of one line fixes (2014) by unwind on Thursday June 23, 2022 @03:41AM (#31846180)
Yeah, I found it hard to understand too.

Was the sarcasm the bit about the bracing, when the actual bug has nothing to do with the goto but instead is the missing post-increment (++)?

Re:A brief history of one line fixes (2014) by Anderkent on Thursday June 23, 2022 @05:47AM (#31846879)
Every 'how is this possible' was sarcastic
Re:A brief history of one line fixes (2014) by kryptiskt on Thursday June 23, 2022 @04:00AM (#31846271)
If you follow the link at the bottom you get to a more analytical blog post: https://flak.tedunangst.com/post/thoughts-on-style-the-TLS-a...

And the context here is that OpenBSD people were really mad about OpenSSL in the aftermath of Heartbleed. It was around this time they forked it into LibreSSL.

Re:A brief history of one line fixes (2014) by jmprspret on Thursday June 23, 2022 @07:12AM (#31847464)
I thought the prose was meant to be more humorous than cynical. I took it as the author cracking jokes about the simple mistakes made. Thought it was funny myself.
Re:A brief history of one line fixes (2014) by Anderkent on Thursday June 23, 2022 @05:47AM (#31846875)
Yeah, the sarcasm is completely counterproductive (as it usually is). The same sentiments expressed sincerely would be a much better read
Re:A brief history of one line fixes (2014) by boffinAudio on Thursday June 23, 2022 @04:23AM (#31846402)
I love these. The best one I saw recently was an off-by-one error that fixed ADC read accuracy on ARM ..

https://lore.kernel.org/all/20210322121923.804433865@linuxfo...

That Wilfried (my boss at the time) got into the CONTRIBUTORS file for that fix is a constant source of amusement ..

Re:A brief history of one line fixes (2014) by gleenn on Thursday June 23, 2022 @03:47AM (#31846213)
I find the lack of tests pretty appalling for this code. How do people ship code and never see something like a user login failure case etc. People talk a lot of trash about TDD, but I feel like a lot of senior devs make this highly egotistical "I know better" argument all the time and I've seen a lot of hot garbage for code because people were too busy to write the test.
Re:A brief history of one line fixes (2014) by lbriner on Thursday June 23, 2022 @05:20AM (#31846706)
I think the challenge is that unless you consider and write the tests first, it is easy to create tests that pass. Test ssl verify? Easy, just mock it returning 1 and the code passes. In real life, however, maybe the return value is -1 and maybe that doesn't work.

Maintaining tests for these sizes of projects is probably quite arduous too. I don't disagree but I still think there are many genuine reasons there are no/not enough tests around this sort of code.

Re:A brief history of one line fixes (2014) by gleenn on Thursday June 23, 2022 @02:35PM (#31853367)
Genuine reasons but ones that still aren't good enough right? There shouldn't be some bar where it was just so difficult on the developer to ship broken security code. If it's that hard, stop writing critical software components and go home.
Re:A brief history of one line fixes (2014) by danuker on Thursday June 23, 2022 @05:12AM (#31846668)
Would tests have found the 1-in-256 password issue for MySQL?

Perhaps property testing, like QuickCheck. I don't think that is exactly TDD.

But I agree with tests and TDD in general.

Re:A brief history of one line fixes (2014) by pards on Thursday June 23, 2022 @08:10AM (#31847918)
> I've seen a lot of hot garbage for code because people were too busy to write the test.

I've seen a lot of hot garbage for code because people were too busy writing the tests and ignoring the readability and idiomatic norms of the production code they were writing.

Re:A brief history of one line fixes (2014) by gleenn on Thursday June 23, 2022 @02:38PM (#31853404)
I firmly believe in TDD where you write the test, watch if correctly fail, make the test in the simplest possible way, and then refactor to make it more readable or idiomatic. Red, green, refactor. I'd rather try and fix ugly code that has tests than try and fix ugly code with no tests. Doing the latter is almost impossible sometimes because you don't even know the exact intent of the code or why some edge case is there etc.
Re:A brief history of one line fixes (2014) by euroderf on Thursday June 23, 2022 @07:17AM (#31847499)
"the lack of tests pretty appalling" => "your lack of tests disturbing". You're welcome :)
Re:A brief history of one line fixes (2014) by chihuahua on Thursday June 23, 2022 @11:03AM (#31850084)
Re: memset - "It's so trivial, it doesn't need a test" And yet... someone managed to get it wrong.
Re:A brief history of one line fixes (2014) by melenaos on Thursday June 23, 2022 @03:18PM (#31853947)
My personal one liner was a static keyword in a web application.

It was working perfectly when they was only one user and this is why it was so difficult to debug.