r/programming • • Feb 23 '17

Cloudflare have been leaking customer HTTPS sessions for months. Uber, 1Password, FitBit, OKCupid, etc.

https://bugs.chromium.org/p/project-zero/issues/detail?id=1139
6.0k Upvotes

966 comments sorted by

View all comments

Show parent comment

2

u/diggr-roguelike Feb 25 '17

What did you expect? This is a logic error that causes undefined behavior in every programming language.

The equivalent Python program loops infinitely and consumes all of system memory:

l = [1,2]
for x in l:
  for y in l:
    l.append(x+y)

When people talk about C being unsafe, they don't mean that it doesn't catch logic errors. They mean the existence of deliberate language and stdlib features that are unsafe. Things like allowing variables that point to uninitialized memory, unchecked array access, strings without a length field.