pike.git / src / encode.c

version» Context lines:

pike.git/src/encode.c:23:   #include "fsort.h"   #include "threads.h"   #include "stuff.h"   #include "version.h"   #include "bignum.h"   #include "pikecode.h"   #include "pike_types.h"   #include "opcodes.h"   #include "peep.h"   #include "pike_compiler.h" + #include "bitvector.h"      /* #define ENCODE_DEBUG */      /* Use the old encoding method for programs. */   /* #define OLD_PIKE_ENCODE_PROGRAM */      #ifdef ENCODE_DEBUG   /* Pass a nonzero integer as the third arg to encode_value,    * encode_value_canonic and decode_value to activate this debug. It    * both enables debug messages and also lessens the pickyness to
pike.git/src/encode.c:2468:    case T_ARRAY:    case T_MULTISET:    case T_NOT:    low_decode_type(data);    push_type(tmp);    break;       case T_INT:    {    INT32 min=0, max=0; -  min = GETC(); -  min = (min<<8)|GETC(); -  min = (min<<8)|GETC(); -  min = (min<<8)|GETC(); -  max = GETC(); -  max = (max<<8)|GETC(); -  max = (max<<8)|GETC(); -  max = (max<<8)|GETC(); +  if(data->ptr + 8 > data->len) +  Pike_error("Decode error: Not enough data in string.\n"); +  min = get_unaligned_be32(data->data + data->ptr); +  data->ptr += 4; +  max = get_unaligned_be32(data->data + data->ptr); +  data->ptr += 4;    push_int_type(min, max);    }    break;       case T_STRING:    /* Common case and compat */    push_finished_type(int_type_string);    push_type(T_STRING);    break;