commit 6f8967eb2086368b10da04b5967892b150dde24b from: Stefan Sperling date: Fri Aug 02 14:18:13 2019 UTC always initialize file index entry's path_len field commit - f2b16adaedf4891924ea61e7f357b02c6cf42bdf commit + 6f8967eb2086368b10da04b5967892b150dde24b blob - ddcbf40125d27f94162bfe698fd1bf4b255e7390 blob + 77e03da75c1d7aebde0f64917c66b39d8286e4d5 --- lib/fileindex.c +++ lib/fileindex.c @@ -139,7 +139,8 @@ got_fileindex_entry_alloc(struct got_fileindex_entry * return err; } - len = strlen(relpath); + (*entry)->path_len = strlen(relpath); + len = (*entry)->path_len; if (len > GOT_FILEIDX_F_PATH_LEN) len = GOT_FILEIDX_F_PATH_LEN; (*entry)->flags |= len; @@ -208,6 +209,7 @@ got_fileindex_entry_get(struct got_fileindex *fileinde struct got_fileindex_entry key; memset(&key, 0, sizeof(key)); key.path = (char *)path; + key.path_len = strlen(path); return RB_FIND(got_fileindex_tree, &fileindex->entries, &key); }