| ▲ | wahern 20 minutes ago | |
From a brief look, I'd say there were several wrong turns made that led to the CVE-2026-123007 overflow bug. For why I think it's unrealistic to go all-in on signed integers in C, it's because sizeof is unsigned, and most APIs dealing with lengths use size_t, and there are many pitfalls when mixing signed and unsigned types. But I agree that there's a good case for using signed for the task behind that CVE. As I said, there are compelling reasons. OpenSSL is a case study in the pitfalls with mixing signed and unsigned in C code. A major reason is the careful dance it has to do mixing signed and unsigned, and it stumbles. There's no substitute for being careful with arithmetic, and at least for me, when I expend that effort I also tend to use overflow checking APIs, clamping, etc, because it's less prone to error. Do that and the benefits of signed start to disappear, or at least the debate starts to lose relevance. Why OpenSSL doesn't create and use a set of overflow checking routines is beyond me as it would simplify an incredible amount of very hairy and brittle code. | ||