Live data from Hacker News

Null

popey.com

11–20 of 196 posts

Re: Null

#11
People like that is the reason why this list was created

https://github.com/minimaxir/big-list-of-naughty-strings/blo...

My personal favorite is this one though

  "If you're reading this, you've been in a coma for almost 20 years now. We're trying a new technique. We don't know where this message will end up in your dream, but we hope it works. Please wake up, we miss you.",

Re: Null

#12

I worked on an API that regularly got requests from the mobile app for GET /users/(null). I think that's Swift, or Obj-C's way of to-string'ing a null? I have a generational suffix on my name. I often include it, and quite often as the proper Unicode character, e.g., "Ⅲ". (Assuming HN displays it after I post this, try to select it; that's one character.) That wreaks a fair bit of havoc. When I was in high-school, I…

That’s how C usually prints it. Swift will print “nil”.

Re: Null

#13

I worked on an API that regularly got requests from the mobile app for GET /users/(null). I think that's Swift, or Obj-C's way of to-string'ing a null? I have a generational suffix on my name. I often include it, and quite often as the proper Unicode character, e.g., "Ⅲ". (Assuming HN displays it after I post this, try to select it; that's one character.) That wreaks a fair bit of havoc. When I was in high-school, I…

That’s how C usually prints it. Swift will print “nil”.

Huh. I feel like I distinctly remember it being both one of our mobile clients, and it being the string "(null)".

Java, perhaps? (That was our Android app, of course.)

Although we did have a desktop app (weirdly) and that was in C++.

Re: Null

#14
post #7

>While I’m not a QA or security professional, I have developed a knack for doing “stupid” things with software which causes it to malfunction. A person after my own heart. I've had many a dev go "why would you do that" In which I answer "it doesn't matter, but if you accept my input it's your job to ensure the app doesn't crash"

Mine too.

I write a lot of javascript and the string "null" is pretty harmless in most code. But there's all sorts of fun bugs (and often security vulnerabilities) you can find if you make an identifier "__proto__". (If code ever uses that as the key in an object, you're off to the races!)

Re: Null

#15
post #9

Earlier quoted context omitted.

I don’t see how a string “null” would break anything besides a very stupidly written program (e.g., one which tries to eval() the input) or an ordinary program written in a very stupid language (e.g., one which tries to coerce strings to other types—PHP, is that you?). I’m a big fan of pattern matching (especially statically verified pattern matching so sorry elixir), but I don’t see how it would help here.

Even PHP finds null==“null” to be false.

And at least you get to strongly compare by adding an extra = (e.g., ===, !==). I just wish the extra character (i.e., the not-as-default versions) weakened instead, like a tilde.

But yes, all strings are truthy. Except an empty string! And maybe some little-used nullish characters? Doubtful, but...

Re: Null

#16

Earlier quoted context omitted.

That’s how C usually prints it. Swift will print “nil”.

Huh. I feel like I distinctly remember it being both one of our mobile clients, and it being the string "(null)". Java, perhaps? (That was our Android app, of course.) Although we did have a desktop app (weirdly) and that was in C++.

Java just prints “null” IIRC. To be fair, the “(null)” you’ll usually get from passing a null pointer to printf is implementation defined (really, undefined, but no implementation I’ve seen has done bad things with it).

Re: Null

#17

I worked on an API that regularly got requests from the mobile app for GET /users/(null). I think that's Swift, or Obj-C's way of to-string'ing a null? I have a generational suffix on my name. I often include it, and quite often as the proper Unicode character, e.g., "Ⅲ". (Assuming HN displays it after I post this, try to select it; that's one character.) That wreaks a fair bit of havoc. When I was in high-school, I…

That’s how C usually prints it. Swift will print “nil”.

I was curious, so I tested that[0], and 3 of the 4 major compilers (clang, gcc, and ICC) all output `(nil)` for a `%p` on a null pointer, but `(null)` for a `%s`. Godbolt doesn't support executing MSVC for some reason.

However, it is my understanding that passing a non-null pointer to printf for `%s` is undefined behavior.

[0]: https://godbolt.org/z/7K5qWv

Re: Null

#18

Earlier quoted context omitted.

That’s how C usually prints it. Swift will print “nil”.

I was curious, so I tested that[0], and 3 of the 4 major compilers (clang, gcc, and ICC) all output `(nil)` for a `%p` on a null pointer, but `(null)` for a `%s`. Godbolt doesn't support executing MSVC for some reason. However, it is my understanding that passing a non-null pointer to printf for `%s` is undefined behavior. [0]: https://godbolt.org/z/7K5qWv

All three are probably using glibc, which does that, yes: https://github.com/ahjragaas/glibc/blob/82cfac84c7e24be587bb.... On Darwin Apple’s libc prints “(null)”: https://github.com/apple-open-source-mirror/Libc/blob/5e566b.... I should also note that passing a non-null pointer to printf is the only correct way to use it ;)

Re: Null

#19

I worked on an API that regularly got requests from the mobile app for GET /users/(null). I think that's Swift, or Obj-C's way of to-string'ing a null? I have a generational suffix on my name. I often include it, and quite often as the proper Unicode character, e.g., "Ⅲ". (Assuming HN displays it after I post this, try to select it; that's one character.) That wreaks a fair bit of havoc. When I was in high-school, I…

I still see \’ appearing on large well trafficked websites, like espn.com and cnn.com.

Re: Null

#20
post #11

People like that is the reason why this list was created https://github.com/minimaxir/big-list-of-naughty-strings/blo... My personal favorite is this one though "If you're reading this, you've been in a coma for almost 20 years now. We're trying a new technique. We don't know where this message will end up in your dream, but we hope it works. Please wake up, we miss you.",

[deleted]
Post reply on HN