Hide Forgot
The function from_base64() in src/libopensc/base64.c assumes signed chars. With unsigned chars, bin_table can be indexed out of bounds: static int from_base64(const char *in, unsigned int *out, int *skip) { unsigned int res = 0, c, s = 18; const char *in0 = in; for (c = 0; c < 4; c++, in++) { u8 b; int k = *in; if (k < 0) return -1; if (k == 0 && c == 0) return 0; b = bin_table[k]; The exact impact of this bug depends on the image layout chosen by the linker. bin_table should end up in the text section, so no information leak is expected, and the worst that could happen is likely a crash.
Created upstream pull request. https://github.com/OpenSC/OpenSC/pull/246