Skip to content

Commit ffa1f44

Browse files
committed
use the safer strnlen()
1 parent d33eb62 commit ffa1f44

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libatalk/cnid/sqlite/cnid_sqlite.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ cnid_t cnid_sqlite_lookup(struct _cnid_db *cdb,
377377
lookup_result_id = sqlite3_column_int64(db->cnid_lookup_stmt, 1);
378378
lookup_result_did = sqlite3_column_int64(db->cnid_lookup_stmt, 2);
379379
snprintf(lookup_result_name, MAXPATHLEN-1, (const char *)sqlite3_column_text(db->cnid_lookup_stmt, 3));
380-
lookup_result_name_len = strlen(lookup_result_name);
380+
lookup_result_name_len = strnlen(lookup_result_name, MAXPATHLEN);
381381
lookup_result_dev = sqlite3_column_int64(db->cnid_lookup_stmt, 4);
382382
lookup_result_ino = sqlite3_column_int64(db->cnid_lookup_stmt, 5);
383383

0 commit comments

Comments
 (0)