Skip to content

Commit

Permalink
don't crash on dumping null extcaps
Browse files Browse the repository at this point in the history
  • Loading branch information
mauke committed Mar 27, 2012
1 parent 818f32e commit 94019bd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion unibilium.c
Expand Up @@ -534,7 +534,9 @@ size_t unibi_dump(const unibi_term *t, char *ptr, size_t n) {
req += ext_count * 2;

for (i = 0; i < t->ext_strs.used; i++) {
ext_tablsz1 += strlen(t->ext_strs.data[i]) + 1;
if (t->ext_strs.data[i]) {
ext_tablsz1 += strlen(t->ext_strs.data[i]) + 1;
}
}
FAIL_INVAL_IF(ext_tablsz1 > MAX15BITS);
req += ext_tablsz1;
Expand Down

0 comments on commit 94019bd

Please sign in to comment.