Live data from Hacker News

Null References: The Billion Dollar Mistake (2009) [video]

infoq.com

1–10 of 130 posts

Re: Null References: The Billion Dollar Mistake (2009) [video]

#3
Nah. The billion dollar mistake is actually C arrays decaying to pointers, enabling buffer overflows, the #1 cause of bugs and malware injection in shipped C programs.

https://www.digitalmars.com/articles/C-biggest-mistake.html

It's simple to fix this in C, too.

Re: Null References: The Billion Dollar Mistake (2009) [video]

#4

Nah. The billion dollar mistake is actually C arrays decaying to pointers, enabling buffer overflows, the #1 cause of bugs and malware injection in shipped C programs. https://www.digitalmars.com/articles/C-biggest-mistake.html It's simple to fix this in C, too.

Absolutely. Null pointers doesn't even make the list of things that I worry about when writing C code.

Re: Null References: The Billion Dollar Mistake (2009) [video]

#5

Nah. The billion dollar mistake is actually C arrays decaying to pointers, enabling buffer overflows, the #1 cause of bugs and malware injection in shipped C programs. https://www.digitalmars.com/articles/C-biggest-mistake.html It's simple to fix this in C, too.

Which would all be a rounding area if C gets to take credit for everything produced using it.

Re: Null References: The Billion Dollar Mistake (2009) [video]

#8

Nah. The billion dollar mistake is actually C arrays decaying to pointers, enabling buffer overflows, the #1 cause of bugs and malware injection in shipped C programs. https://www.digitalmars.com/articles/C-biggest-mistake.html It's simple to fix this in C, too.

We could go further: the billion dollar mistake was allowing values intended to be used as data to be executed (pre-NX bit). Zero-terminated C strings is up there as well.

Re: Null References: The Billion Dollar Mistake (2009) [video]

#9

Nah. The billion dollar mistake is actually C arrays decaying to pointers, enabling buffer overflows, the #1 cause of bugs and malware injection in shipped C programs. https://www.digitalmars.com/articles/C-biggest-mistake.html It's simple to fix this in C, too.

I think golang's slices are a better solution than the linked article.

https://go.dev/ref/spec#Slice_types

Slices can still be nil (null), but it isn't an unsafe memory access operation, just another type of potentially useful or potentially errant invocation to handle.

Re: Null References: The Billion Dollar Mistake (2009) [video]

#10

Nah. The billion dollar mistake is actually C arrays decaying to pointers, enabling buffer overflows, the #1 cause of bugs and malware injection in shipped C programs. https://www.digitalmars.com/articles/C-biggest-mistake.html It's simple to fix this in C, too.

I think this is actually an artifact of the 'check the single return value for errors' that requires that the return domain contain at least one error code point.

how else you might structure errors without changing much of the rest of C left for an exercise

Post reply on HN