Branch: Tag:

2017-02-20

2017-02-20 10:59:22 by Henrik Grubbström (Grubba) <grubba@grubba.org>

encode_value: Improved robustness against program_id wrap-around.

Unlikely to happen, but a dump file with a negative program_id
has shown up (albeit most likely due to some form of corruption).

936:    case T_PROGRAM:    {    int d; -  if (val->u.program->id < PROG_DYNAMIC_ID_START) { +  if ((val->u.program->id < PROG_DYNAMIC_ID_START) && +  (val->u.program->id >= 0)) {    code_entry(TAG_PROGRAM, 3, data);    push_int(val->u.program->id);    encode_value2(Pike_sp-1, data, 0);