Похожие чаты

Guys. I Wana cast a lparam to some structure in

my code.(on windows)

And after that, access members of that struct and do some calculations.

Simetines this cast results to null. And if I access those members of struct, I'll get a segfault.

How ensure about validity of these kinds of casts?

6 ответов

6 просмотров

check against null before accessing it

Пользователь-61653 Автор вопроса
Parra
check against null before accessing it

I checked it. It's always not null but dereftencing it willy cause segfault.

Пользователь 61653
Sorry?

https://stackoverflow.com/questions/42588482/c-accessing-data-after-memory-has-been-freeed

Пользователь 61653
Sorry?

https://en.m.wikipedia.org/wiki/Dangling_pointer

Похожие вопросы

Обсуждают сегодня

Всем привет, написал код ниже, но он выдает сегфолт, в чем причина? #include <stdio.h> #include <stdlib.h> #include <string.h> struct product { char *name; float price; };...
buzz базз
32
Хотел бы спросить у знающих, правильную ли я выбрал книгу для начала изучения ассемблера Юрова В.И ? Или есть более лучшие книги для начала обучения?
Botsman
25
Добрый день, не подскажите, если в OC-V3 поменять страндартную директорию /storage/ на /storage2/ - не будет сильно много проблем ?
Max Dubovsky
32
Conversation at a festival with a non-crpto person (not a normie by any stretch, though): * person: tell me about crypto, me: ok, the original idea is p2p sound money for the...
molecular#123 🐓
25
Книга Юрова В.И пойдёт для обучения?
Botsman
24
$params = [ 'formid' => 'feedbackForm', 'formTpl' => '@CODE: <form class="form-validate" data-id="ajax_form"> <fieldset class="margin-bottom-md"> ...
Pathologic
1
> Примечательно, что новый владелец удаляет из GitHub любые жалобы, указывающие на подозрительную активность или смену владельца, и, видимо, рассчитывает на то, что пользовате...
Alex Sherbakov
1
I bought some PHA tokens on Kucoin, which is the best wallet to store and easy to use?
AMR
19
'frakturBold' => ['𝖆', '𝖇', '𝖈', '𝖉', '𝖊', '𝖋', '𝖌', '𝖍', '𝖎', '𝖏', '𝖐', '𝖑', '𝖒', '𝖓', '𝖔', '𝖕', '𝖖', '𝖗', '𝖘', '𝖙', '𝖚', '𝖛', '𝖜', '𝖝', '𝖞', '𝖟', '𝕬', '𝕭', '𝕮', '𝕯'...
Roma
4
Подскажите пожалуйста, а я могу вот такую штуку использовать? rpc, только реализованное в реббите https://www.rabbitmq.com/tutorials/tutorial-six-php ( или https://habr.com/ru...
Artyom
11
Карта сайта