Skip to content

Commit c73c3fd

Browse files
committed
PHPC-124: Buffer not null terminated
1 parent 99d723e commit c73c3fd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php_phongo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ int phongo_execute_command(mongoc_client_t *client, char *db, bson_t *command, m
657657
const char *ns;
658658

659659
ns = bson_iter_utf8 (&child, &cursor->nslen);
660-
strncpy (cursor->ns, ns, sizeof cursor->ns);
660+
bson_strncpy (cursor->ns, ns, sizeof cursor->ns);
661661
} else if (BSON_ITER_IS_KEY (&child, "firstBatch")) {
662662
if (BSON_ITER_HOLDS_ARRAY (&child)) {
663663
const uint8_t *data = NULL;

0 commit comments

Comments
 (0)