mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-23 21:29:49 +00:00
Fix null derefs on RCons when no context is provided ##cons
This commit is contained in:
parent
2fe490c4cd
commit
4ae1527bd2
@ -306,7 +306,7 @@ R_API void r_cons_break_clear(void) {
|
||||
}
|
||||
|
||||
R_API void r_cons_context_break_push(RConsContext *context, RConsBreak cb, void *user, bool sig) {
|
||||
if (!context->break_stack) {
|
||||
if (!context || !context->break_stack) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -333,7 +333,7 @@ R_API void r_cons_context_break_push(RConsContext *context, RConsBreak cb, void
|
||||
}
|
||||
|
||||
R_API void r_cons_context_break_pop(RConsContext *context, bool sig) {
|
||||
if (!context->break_stack) {
|
||||
if (!context || !context->break_stack) {
|
||||
return;
|
||||
}
|
||||
//restore old state
|
||||
@ -381,7 +381,7 @@ R_API bool r_cons_is_breaked(void) {
|
||||
I.timeout = 0;
|
||||
}
|
||||
}
|
||||
return I.context->breaked;
|
||||
return I.context && I.context->breaked;
|
||||
}
|
||||
|
||||
R_API void r_cons_line(int x, int y, int x2, int y2, int ch) {
|
||||
|
Loading…
Reference in New Issue
Block a user