If the len is less than 24, heap buffer overflow is reported.
Signed-off-by: Randall Huang <huangrandall@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
int i = 0, bits = 0, ac = 0;
char *cp = dst;
- while (i < len) {
+ while (i < len && i < 24) {
ac += (((unsigned char) src[i]) << bits);
bits += 8;
do {
}
*new = '_';
- return digest_encode((const char *)name, 24, (char *)new + 1);
+ return digest_encode((const char *)name, len, (char *)new + 1);
}
static void print_dentry(__u32 depth, __u8 *name,