commit 8891c2aba6a5f6cd43ab51b67115d4fbd0976f73 from: Stefan Sperling date: Thu Dec 17 20:46:54 2020 UTC fix crash in path_list_reverse_input() after switch to unsigned loop index commit - 85f4e1e7d36a206d3861d49c00e207d3e7fcab80 commit + 8891c2aba6a5f6cd43ab51b67115d4fbd0976f73 blob - 792c8cdc3d09be7a750bb57780cb89ea60c1e627 blob + 231a6477402c69e760b2ab21b75fee238ebbddff --- regress/path/path_test.c +++ regress/path/path_test.c @@ -178,7 +178,7 @@ path_list_reverse_input(void) size_t i; TAILQ_INIT(&paths); - for (i = nitems(path_list_input) - 1; i >= 0; i--) { + for (i = nitems(path_list_input) - 1; i > 0; i--) { err = got_pathlist_insert(NULL, &paths, path_list_input[i], NULL); if (err) { @@ -186,6 +186,11 @@ path_list_reverse_input(void) return 0; } } + err = got_pathlist_insert(NULL, &paths, path_list_input[0], NULL); + if (err) { + test_printf("%s\n", __func__, err->msg); + return 0; + } i = 0; TAILQ_FOREACH(pe, &paths, entry) {