Alexandre Julliard wrote:
Aurimas Fišeras aurimas@gmail.com writes:
How to know when to fix NULL pointer dereferences if in most such cases code flow can be traced back to a windows API called by "other program"?
If some other program is really calling it with NULL then you can fix it. You can't preemptively fix every API that takes a pointer.
OK, I won't "fix" any windows API if no program calls it, although I don't believe that is right.
But what about this and similar situations?
Error report: server/debugger.c:160 red Possible NULL dereference of exe_module Intraprocedural Null error
143: struct process_dll *exe_module = get_process_exe_module( process ); ... 160: if (exe_module->file &&
process.h: static inline struct process_dll *get_process_exe_module( struct process *process ) { struct list *ptr = list_head( &process->dlls ); return ptr ? LIST_ENTRY( ptr, struct process_dll, entry ) : NULL; }
What should I do? 1. change get_process_exe_module() to return LIST_ENTRY( ptr, struct process_dll, entry ); 2. change debugger.c:160 to if (exe_module && exe_module->file && 3. inspect list_head()? 4. ignore it?