Skip to content

Commit

Permalink
Fix hangs and segfaults when egregiously long symbol is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
danluu committed Sep 5, 2014
1 parent 8b1fb17 commit 839cf67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,10 @@ static jl_sym_t *mk_symbol(const char *str)
size_t len = strlen(str);
size_t nb = (sizeof(jl_sym_t)+len+1+7)&-8;

if (len >= SYM_POOL_SIZE) {
jl_error("Symbol length exceeds maximum length");
}

#ifdef MEMDEBUG
sym = (jl_sym_t*)malloc(nb);
#else
Expand Down

0 comments on commit 839cf67

Please sign in to comment.