[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: ded.png (15 KB, 574x588)
15 KB
15 KB PNG
What happens if I deference a null pointer?
>>
>>101542700
You get slapped by Bret Hart
>>
Try it yourself
#include <stdlib.h>

int main() {
free(NULL);
}
>>
>>101542700
you try to access memory
it likely fails miserably because userspace or succeeds even MORE miserably
end
>>
>>101542700
you get an error in the static analyzer you're using to verify you're code.
you are using a static analyzer, right?
>>
File: notdealingwiththis.png (441 KB, 470x791)
441 KB
441 KB PNG
>>101542700
Anything and everything can happen.
>>
>>101542700
https://youtu.be/dFIqNZ8VbRY
tl;dr it depends
>>
Usually (modern OS in user space) it segfaults because that address isn't mapped.
>>
couldn't tell you, since it's impossible in rust
>>
>>101542869
Box::leak
>>
>>101542869
Sounds like Rust is inferior.
>>
>>101542869
like it is impossible for a man to become a woman
>>
seems like I hit a nerve, kek. Seethe, cniles
>>
>>101542700
>deference
You mean defenestrate? The pointer gets glassed (and we ain't leavin til we find oot what cunt did it).
>>
>>101542700
Nothing. Just use this in your program, trust me:
signal(SIGSEGV, SIG_IGN);
>>
File: GTGQtjTX0AAh22X.jpg (37 KB, 750x541)
37 KB
37 KB JPG
>>101542948
You will NEVER pass,
EVER
Your friends lie to you to make you feel better
;-)
>>
>>101543449
Embrace the future chud. Most programmers are retards so we need the borrow checker to tardwrangle everyone.
>>
>deference
That's not the word that you think it is
>>
>>101543544
We dont need more programmers in the first place, what a stupid premise.
>>
What ever happened to little bobby tabbles
>>
>>101542700
In MSDOS it lets you write over the timer interrupt.
>>
You get hired for Crowdstrike



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.