]> git.ipfire.org Git - thirdparty/kmod.git/commit
shared: use proper data types in freadline_wrapped
authorTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 20 Aug 2024 20:52:41 +0000 (22:52 +0200)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 22 Aug 2024 21:43:30 +0000 (16:43 -0500)
commit84eff55d4d68b3705a86ff184aab558dfd3ce804
treef5d0d6c5a8dc072c55d83ec5c1a46fb6de9c39a4
parent56bebc9a0e0f0983df27513be7e3d68c2b6207d4
shared: use proper data types in freadline_wrapped

Do not use signed data types if unsigned arithmetic is expected,
i.e. use size_t if processing sizes and unsigned int for line numbers
due to given API of freadline_wrapped.

This fixes a possible signed integer overflow on 64 bit systems.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/81
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
shared/util.c