pike.git / lib / modules / Standards.pmod / BSON.pmod / module.pmod

version» Context lines:

pike.git/lib/modules/Standards.pmod/BSON.pmod/module.pmod:134:    }    // BSON.Timestamp instance    else if(objectp(value) && Program.inherits(object_program(value), .Timestamp))    {    buf->sprintf("%c%s%c%-8c", TYPE_TIMESTAMP, key, 0, value->get_timestamp());    }       // BSON.Binary instance    else if(objectp(value) && Program.inherits(object_program(value), .Binary))    { -  buf->sprintf("%c%s%c%-4c%c%s", TYPE_BINARY, key, 0, sizeof(value)+1, value->subtype, (string)value); +  buf->sprintf("%c%s%c%-4c%c%s", TYPE_BINARY, key, 0, sizeof(value), value->subtype, (string)value);    }    // BSON.Symbol instance    else if(objectp(value) && Program.inherits(object_program(value), .Symbol))    {    string v = (string)value;    v = string_to_utf8(v);    buf->sprintf("%c%s%c%-4c%s%c", TYPE_SYMBOL, key, 0, sizeof(v)+1, v, 0);    }    // BSON.Javascript instance    else if(objectp(value) && Program.inherits(object_program(value), .Javascript))
pike.git/lib/modules/Standards.pmod/BSON.pmod/module.pmod:252: Inside #if defined(BSON_PIKE_ONLY)
   case TYPE_STRING:    if(sscanf(slist, "%-4c%s", len, slist) != 2)    ERROR("Unable to read string length from BSON stream.\n");    if(sscanf(slist, "%" + (len-1) + "s\0%s", value, slist) != 2)    ERROR("Unable to read string from BSON stream.\n");    value = utf8_to_string(value);    break;    case TYPE_BINARY:    if(sscanf(slist, "%-4c%s", len, slist) != 2)    ERROR("Unable to read binary length from BSON stream.\n"); -  if(sscanf(slist, "%c%" + (len-1) + "s\0%s", subtype, value, slist) != 2) +  if(sscanf(slist, "%c%" + (len) + "s%s", subtype, value, slist) < 2)    ERROR("Unable to read binary from BSON stream.\n");    value = .Binary(value, subtype);    break;    case TYPE_JAVASCRIPT:    if(sscanf(slist, "%-4c%s", len, slist) != 2)    ERROR("Unable to read javascript length from BSON stream.\n");    if(sscanf(slist, "%" + (len-1) + "s\0%s", value, slist) != 2)    ERROR("Unable to read javascript from BSON stream.\n");    value = .Javascript(utf8_to_string(value));    break;