Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit 3f8336e

Browse files
committed
PHP-1467: Use endian macro when reading string length
1 parent a7aaeb9 commit 3f8336e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mcon/mini_bson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ int bson_find_field_as_stringl(char *buffer, char *field, char **data, int32_t *
472472
char* tmp = bson_find_field(buffer, field, BSON_STRING);
473473

474474
if (tmp) {
475-
*length = ((int32_t*)tmp)[0];
475+
*length = MONGO_32( ((int32_t*)tmp)[0] );
476476
*data = duplicate ? strdup(tmp + 4) : tmp + 4; /* int32 for length */
477477
return 1;
478478
}

0 commit comments

Comments
 (0)