mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-10 09:39:03 -04:00
[tfman] fix two problems found by fuzzing #2475
This commit is contained in:
parent
acffa61557
commit
5ea69031ca
@ -351,12 +351,14 @@ draw_domnode(struct ncplane* p, const pagedom* dom, const pagenode* n,
|
|||||||
putpara(p, n->text);
|
putpara(p, n->text);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
|
if(n->text){
|
||||||
ncplane_set_styles(p, NCSTYLE_BOLD | NCSTYLE_ITALIC);
|
ncplane_set_styles(p, NCSTYLE_BOLD | NCSTYLE_ITALIC);
|
||||||
ncplane_set_fg_rgb(p, 0xff6a00);
|
ncplane_set_fg_rgb(p, 0xff6a00);
|
||||||
ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text);
|
ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text);
|
||||||
ncplane_set_fg_default(p);
|
ncplane_set_fg_default(p);
|
||||||
ncplane_set_styles(p, NCSTYLE_NONE);
|
ncplane_set_styles(p, NCSTYLE_NONE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
*wrotetext = true;
|
*wrotetext = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -104,7 +104,7 @@ const trofftype* get_type(const struct troffnode* trie, const unsigned char** ws
|
|||||||
++*ws;
|
++*ws;
|
||||||
--len;
|
--len;
|
||||||
while(len && !isspace(**ws) && **ws){
|
while(len && !isspace(**ws) && **ws){
|
||||||
if(**ws > sizeof(trie->next) / sizeof(*trie->next)){ // illegal command
|
if(**ws >= sizeof(trie->next) / sizeof(*trie->next)){ // illegal command
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
if((trie = trie->next[**ws]) == NULL){
|
if((trie = trie->next[**ws]) == NULL){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user