Skip to content

Commit f4fd188

Browse files
committed
Fixed CID-60852: Pointer to local outside scope
Pointer to local outside scope: `key` points to an out-of-scope variable `numbuf` :]
1 parent 4e738bd commit f4fd188

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/bson.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,7 @@ PHONGO_API void zval_to_bson(zval *data, phongo_bson_flags_t flags, bson_t *bson
750750
for (;; zend_hash_move_forward_ex(ht_data, &pos)) {
751751
unsigned int key_len = 0;
752752
uint64_t index = 0;
753+
char numbuf[32];
753754
char *key = NULL;
754755
zval **entry;
755756
int hash_type = HASH_KEY_NON_EXISTENT;
@@ -781,8 +782,6 @@ PHONGO_API void zval_to_bson(zval *data, phongo_bson_flags_t flags, bson_t *bson
781782
}
782783
}
783784
} else {
784-
char numbuf[32];
785-
786785
key_len = bson_uint32_to_string(index, (const char **)&key, numbuf, sizeof(numbuf));
787786
}
788787

0 commit comments

Comments
 (0)