diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2023-01-09 01:30:40 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2023-01-09 01:43:24 +0100 |
commit | 655393e953086ec24ee18e07b022c6863c5dda5d (patch) | |
tree | b1d4154cc4beb557262bad67a14482afe4963160 /nDPId.c | |
parent | e9443d7618276873f2dbcb2bdffca5d9991c1f84 (diff) |
nDPid: Fixed base64encode bug which lead to invalid base64 strings.
* py-semantic-validation: Decode base64 raw packet data as well
* nDPIsrvd.py: Added PACKETS_PLEN_MAX
* nDPIsrvd.py: Improved JSON parse error/exception handling
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'nDPId.c')
-rw-r--r-- | nDPId.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -2406,7 +2406,7 @@ static void base64encode(uint8_t const * const data_buf, * if we have one byte available, then its encoding is spread * out over two characters */ - if (resultIndex + 2 >= *resultSize - padCount - 1) + if (resultIndex + 2 >= *resultSize - (3 - padCount)) { break; } @@ -2419,7 +2419,7 @@ static void base64encode(uint8_t const * const data_buf, */ if ((x + 1) < dataLength) { - if (resultIndex + 1 >= *resultSize - padCount - 1) + if (resultIndex + 1 >= *resultSize - (3 - padCount)) { break; } @@ -2432,7 +2432,7 @@ static void base64encode(uint8_t const * const data_buf, */ if ((x + 2) < dataLength) { - if (resultIndex + 1 >= *resultSize - padCount - 1) + if (resultIndex + 1 >= *resultSize - (3 - padCount)) { break; } |