Re: [PATCH 4/4] libkeymap: add NULL check in lk_dump_ctable diacritical loop
Areg Krdyan <[email protected]> Sun, 15 Feb 2026 11:04:05 +0300
| Newsgroups | dev.linux.lists.kbd |
|---|---|
| Message-ID | <CAMj1D1VLW_0tn_3=HT7--W53K67vKv21+hMqQWFz6vK8wd1Npw@mail.gmail.com> |
Thanks for the reply! All the changes that I made were done by myself.
I am currently undergoing an internship at Redsoft and my task is to
check the output of the static analyzer for kbd. I also wanted to fix
these static analyzer calls, some of them have already been fixed. Not
all of them are real errors, but they can help to detect the error
when changing the code.
Such checks are already in the project. Eg:
for (t = 0; t < MAX_NR_KEYMAPS; t++) { // libkeymap/kernel.c:24
if (t > UCHAR_MAX) {
ERR(ctx, _("table %d must be less than %d"), t, UCHAR_MAX);
return -1;
}
.....
}
With these constants, the error will never be triggered, since
MAX_NR_KEYMAPS = 256 and UCHAR_MAX = 255. But in the future, when
changing MAX_NR_KEYMAPS, it will be useful to have a check to detect
an error.
Please let me know if patches of this kind are not needed.
Thanks again for your time.