Ticket #513 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

Block buffers are wrong sizes in NSDataAdditions initWithBase64EncodedString

Reported by: chris@wouldja.com Assigned to: timothy
Priority: normal Component: Chat Core (File Transfer)
Version: 2.0 (2D16) Severity: blocker
Keywords: Cc:

Description

On line 26 of NSDataAdditions.m, the sizes of the inbuf and outbuf arrays are swapped. If you're decoding base 64, inbuf should have 4 elements, and outbuf should have 3. This code does not correctly decode base 64 in its current state...

basically, it reads: unsigned char inbuf[3], outbuf[4];

instead, it should read: unsigned char inbuf[4], outbuf[3];