Check sizeof(base64_dec_tab) in base64 encoding; fix #3947

The issue (and the fix) reported by https://hackerone.com/aerodudrizzt
This commit is contained in:
Yukihiro "Matz" Matsumoto
2018-02-13 08:55:24 +09:00
parent 7483753094
commit ef1a0e6358
+1 -1
View File
@@ -806,7 +806,7 @@ unpack_m(mrb_state *mrb, const void *src, int slen, mrb_value ary, unsigned int
ch[i] = 0;
padding++;
}
} while (ch[i] == PACK_BASE64_IGNORE);
} while (c >= sizeof(base64_dec_tab) || ch[i] == PACK_BASE64_IGNORE);
}
l = (ch[0] << 18) + (ch[1] << 12) + (ch[2] << 6) + ch[3];