Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depmod: Properly check index keys #247

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tools/depmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ _printf_format_(1, 2) static inline void _show(const char *fmt, ...)
#define INDEX_VERSION_MAJOR 0x0002
#define INDEX_VERSION_MINOR 0x0001
#define INDEX_VERSION ((INDEX_VERSION_MAJOR << 16) | INDEX_VERSION_MINOR)
#define INDEX_CHILDMAX 128
#define INDEX_CHILDMAX 128u

struct index_value {
struct index_value *next;
Expand Down Expand Up @@ -208,7 +208,7 @@ static void index__checkstring(const char *str)
int i;

for (i = 0; str[i]; i++) {
int ch = str[i];
unsigned char ch = (unsigned char)str[i];

if (ch >= INDEX_CHILDMAX)
CRIT("Module index: bad character '%c'=0x%x - only 7-bit ASCII is supported:"
Expand Down