--- ./whoopsie/lib/bson/bson.c 2020-04-18 13:52:03.030969618 +0900 +++ ./whoopsie-fixed/lib/bson/bson.c 2020-04-19 18:31:45.762772248 +0900 @@ -662,6 +662,9 @@ static int bson_append_estart( bson *b, int type, const char *name, const uint32_t dataSize ) { const uint32_t len = strlen( name ) + 1; + if ( len > INT32_MAX ) + return BSON_ERROR; + if ( b->finished ) { b->err |= BSON_ALREADY_FINISHED; return BSON_ERROR;