Add overflow check to calloc in doListFontsAndAliases
Fixes the following compiler warning:
../dix/dixfonts.c: In function ‘doListFontsAndAliases’: ../dix/dixfonts.c:748:25: warning: argument 2 range [2147483648, 4294967295] exceeds maximum object size 2147483647 [-Walloc-size-larger-than=] 748 | char *bufferStart = calloc(1, rep.length << 2);
This could lead to undefined behavior or crash due to integer overflow in the calloc size calculation.
This is my first PR — happy to make changes if needed!
@BrightCat14 thanks for your submission.
This particular function suffers from some more architectural problems: we shouldn't read from reply structs at all, just declare/assign them in one shot right before writing them out. That's important for upcoming/ongoing protocol marshaling refactoring. See eg branch: wip/swapping_new.
@BrightCat14 ping needs rebase
@BrightCat14 needs rebase