commit 73c9f4bdbc784d2df07d3abe125c8166210f41fa from: Markus Uhlin date: Tue Nov 18 18:27:36 2025 UTC Fixed null pointer dereference in UpdateRank() -- found by PVS-Studio commit - 3aa1e8e41036542e6d88898603cd3244f19b68e8 commit + 73c9f4bdbc784d2df07d3abe125c8166210f41fa blob - 8113c6dea2c28f5a883be533bf70d9c2c21649c1 blob + a207627e9bda703e44568f6dbc65ecc82de212b7 --- FICS/ratings.c +++ FICS/ratings.c @@ -1530,8 +1530,16 @@ UpdateRank(int type, char *addName, statistics *sNew, CompareStats(addName, sNew, login, &sCur) > 0) { int computer = in_list(-1, L_COMPUTER, addName); - fprintf(fptemp, "%s %d %d %d\n", addName, sNew->rating, - sNew->num, computer); + if (sNew) { + fprintf(fptemp, "%s %d %d %d\n", addName, + sNew->rating, sNew->num, computer); + } else { + warnx("%s: 'sNew' null: addName = %s", __func__, + addName); + fprintf(fptemp, "%s %d %d %d\n", addName, + 0, 0, computer); + } + addName = NULL; }