Re: [PATCH ] sysctl: fix uninitialized variable in proc_do_large_bitmap
From: buermarc
Date: Tue Mar 17 2026 - 17:32:29 EST
From: Marc Buerg <buermarc@xxxxxxxxxxxxxx>
Hello Peter,
c will be overwritten by the previous proc_get_long() calls but that
will not be a problem. We only check c again if we had another trailing
char in either tr_a or tr_b[] = { ',', '\n', 0 }, minus '-'. If we find
a first '-' we will only reach the check again after hitting a trailing
char in tr_b. This ensures c must not be '-' before we might encounter a
new '-'. Meaning c should not contain a problematic value in future
iterations, but only in the first.
I agree: checking for left, as you proposed, should be done. I'll drop
setting c to zero and create a new patch which checks left.
Kind Regards,
Marc