News for hackers. Stuff that matters.
Re:Show HN: MassDNS – A high-performance DNS stub resolver in C by blechschmidt on Saturday June 25, 2016 @07:57PM (#11978687)
Malloc results are checked by the safe_malloc function in security.h. Could you point out a line that is prone to integer overflows?
Re:Show HN: MassDNS – A high-performance DNS stub resolver in C by audidude on Saturday June 25, 2016 @08:00PM (#11978697)
stream_buffer_init() calls malloc directly, so it's not protected by safe_malloc(). (Unless there is some funky re-define stuff I didn't see).

%x takes unsigned int, not a char. (Although I guess you could just rely on promotion here if you can rely on the unsignedness of char).

> Could you point out a line that is prone to integer overflows?

Never said that it was an overflow (just C&P that comment from the file). Just said its invalid use. Which I'm totally willing to agree on the compiler mostly getting correct behavior. Just not really something I'd want to see landing in something that we all need a really good, secure implementation of.

Best of luck though, I hope you iterate on this to the point we can have a really good DNS implementation in C, in user-space, with optional async processing.

Re:Show HN: MassDNS – A high-performance DNS stub resolver in C by userbinator on Saturday June 25, 2016 @11:20PM (#11979252)
Although I guess you could just rely on promotion here if you can rely on the unsignedness of char

If compilers did not do promotion, they would be very obviously not compliant with the C standard and unable to compile correctly most existing code, so I'm willing to bet that is something you can rely on. It's defined by the standard and widely used.

Re:Show HN: MassDNS – A high-performance DNS stub resolver in C by audidude on Saturday June 25, 2016 @11:37PM (#11979284)
Sure, but in this case it was signed to unsigned promotion.
Re:Show HN: MassDNS – A high-performance DNS stub resolver in C by blechschmidt on Saturday June 25, 2016 @11:43PM (#11979294)
Why should that matter in this case? The worst case would have been the output of a wrong value and it was some commented out debug output which I have used in a very specific case.
Re:Show HN: MassDNS – A high-performance DNS stub resolver in C by audidude on Sunday June 26, 2016 @12:01AM (#11979321)
Totally, just wrong value. This thread is already making a bigger deal of it than I expected it to.
Re:Show HN: MassDNS – A high-performance DNS stub resolver in C by blechschmidt on Saturday June 25, 2016 @08:11PM (#11978739)
Thank you for pointing this out. This file actually contained some unused code that was not supposed to make it into the repository so I just removed it. The "%x" format specifiers were located in debug comments that have been commented out. They have also been removed now.