Synchronize character checks with libkmod-index.c. 8-bit ASCII chars
would turn negative (due to signed char), which index__checkstring does
not properly check for.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/247
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
#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;
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:"