|
|
| version 1.89, 2019/11/13 21:29:51 | version 1.92, 2019/11/15 11:09:51 |
|---|---|
| Line 10 | Line 10 |
| #include "pa_vmethod_frame.h" | #include "pa_vmethod_frame.h" |
| #include "pa_common.h" | #include "pa_common.h" |
| #include "pa_base64.h" | |
| #include "pa_vint.h" | #include "pa_vint.h" |
| #include "pa_vmath.h" | #include "pa_vmath.h" |
| #include "pa_vfile.h" | #include "pa_vfile.h" |
| Line 634 static void _convert(Request& r, MethodP | Line 635 static void _convert(Request& r, MethodP |
| return; | return; |
| } | } |
| // core | // core, using log since log2 is not present in FreeBSD < 8.X |
| Array<char> remainders(round(data.length * log2(base_from) / log2(base_to)) + 1); | Array<char> remainders((size_t)round(data.length * log2(base_from) / log2(base_to)) + 1); |
| do { | do { |
| int carry = 0; | int carry = 0; |
| Line 668 static void _convert(Request& r, MethodP | Line 669 static void _convert(Request& r, MethodP |
| result_file->set(true /*tainted*/, 0 /*binary*/, result_str, result_length, 0, 0, &r); | result_file->set(true /*tainted*/, 0 /*binary*/, result_str, result_length, 0, 0, &r); |
| r.write(*result_file); | r.write(*result_file); |
| } else { | } else { |
| r.write(*new String(result_str, String::L_TAINTED)); // note: there can be '\0' inside | if(memchr(result_str, 0, result_length)) |
| throw Exception(PARSER_RUNTIME, 0, "Invalid \\x00 character found while converting to string. Convert to file instead."); | |
| fix_line_breaks(result_str, result_length); | |
| if(result_length) | |
| r.write(*new String(result_str, String::L_TAINTED)); | |
| } | } |
| } | } |