mirror of
https://github.com/dankamongmen/notcurses.git
synced 2024-11-08 01:10:23 +00:00
[tfman] fix two problems found by fuzzing #2475
This commit is contained in:
parent
acffa61557
commit
5ea69031ca
@ -351,11 +351,13 @@ draw_domnode(struct ncplane* p, const pagedom* dom, const pagenode* n,
|
||||
putpara(p, n->text);
|
||||
}
|
||||
}else{
|
||||
ncplane_set_styles(p, NCSTYLE_BOLD | NCSTYLE_ITALIC);
|
||||
ncplane_set_fg_rgb(p, 0xff6a00);
|
||||
ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text);
|
||||
ncplane_set_fg_default(p);
|
||||
ncplane_set_styles(p, NCSTYLE_NONE);
|
||||
if(n->text){
|
||||
ncplane_set_styles(p, NCSTYLE_BOLD | NCSTYLE_ITALIC);
|
||||
ncplane_set_fg_rgb(p, 0xff6a00);
|
||||
ncplane_putstr_aligned(p, -1, NCALIGN_CENTER, n->text);
|
||||
ncplane_set_fg_default(p);
|
||||
ncplane_set_styles(p, NCSTYLE_NONE);
|
||||
}
|
||||
}
|
||||
*wrotetext = true;
|
||||
break;
|
||||
|
@ -104,7 +104,7 @@ const trofftype* get_type(const struct troffnode* trie, const unsigned char** ws
|
||||
++*ws;
|
||||
--len;
|
||||
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;
|
||||
}
|
||||
if((trie = trie->next[**ws]) == NULL){
|
||||
|
Loading…
Reference in New Issue
Block a user