commit 9fc4efff71ba54d571f1fdb48747539463d2a651 from: Markus Uhlin date: Mon Sep 8 15:49:09 2025 UTC Disallow integer overflow commit - 6f5f9000271a4a723ca93d6705c03ec8aaf39a0f commit + 9fc4efff71ba54d571f1fdb48747539463d2a651 blob - ea6e71568f54ceca37e6ad0d7448101d30e1dbb2 blob + 0fdf90a0570b49ea4807e50781f29e6c4ba727f6 --- FICS/network.c +++ FICS/network.c @@ -12,6 +12,7 @@ #include #include +#include #include "common.h" #include "config.h" @@ -369,8 +370,11 @@ readline2(comstr_t *cs, int who) if (con[who].processed) s += v_pending; - else + else { + if (bytes_received + v_pending > INT_MAX) + errx(1, "%s: integer overflow", __func__); bytes_received += v_pending; + } d = s; while (bytes_received-- > 0) {