Permalink
Browse files

don't crash on dumping null extcaps

  • Loading branch information...
1 parent 818f32e commit 94019bd7b47afcbf9c0ecbb117fa63d33c02b786 @mauke committed Mar 27, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 unibilium.c
View
@@ -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;

0 comments on commit 94019bd

Please sign in to comment.