Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Return NaN instead of 0.0 on out-of-bounds read in CArray.
  • Loading branch information
arnsholt committed Feb 2, 2013
1 parent f08620a commit e221d3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/6model/reprs/CArray.c
Expand Up @@ -231,9 +231,11 @@ static void at_pos_native(PARROT_INTERP, STable *st, void *data, INTVAL index, N
case NATIVE_VALUE_INT:
value->value.intval = 0;
return;
case NATIVE_VALUE_FLOAT:
value->value.floatval = 0.0;
case NATIVE_VALUE_FLOAT: {
double x = 0.0;
value->value.floatval = 0.0/x;
return;
}
case NATIVE_VALUE_STRING:
value->value.stringval = STRINGNULL;
return;
Expand Down

0 comments on commit e221d3d

Please sign in to comment.