Hard crash when doing EncodeBase64

Got a couple of crash reports from a user. How can you screw up EncodeBase64???

Thread 4 Crashed:
0 libsystem_platform.dylib 0x00007fff5d3026f2 _platform_strlen + 18
1 com.xojo.XojoFramework 0x000000010dc7132a StringOpsClassic::ConstructFromBuffer(char const*, unsigned int, int) + 28
2 com.xojo.XojoFramework 0x000000010dc7f9fc string::ConstructFromBuffer(char const*, unsigned long, unsigned int) + 78
3 com.xojo.XojoFramework 0x000000010dc55e32 REALBuildString(char const*, int) + 40
4 InternetEncodings.dylib 0x00000001103659dc 0x110365000 + 2524
5 com.mothsoftware.mailarchiverx 0x000000010a42c40a _InternalGlobals7.EncodeBase64%s%si8 + 58
6 com.mothsoftware.mailarchiverx 0x000000010b13790d MimeAttachment.getHtmlPreview%s%ob + 701
7 com.mothsoftware.mailarchiverx 0x000000010b0f3525 MimeParser.parseChildPart%%oo + 9269
8 com.mothsoftware.mailarchiverx 0x000000010b0ed4e7 MimeParser.parseMixed%%oo + 1031
9 com.mothsoftware.mailarchiverx 0x000000010b0e9401 MimeParser.parseMime%%oo + 849
10 com.mothsoftware.mailarchiverx 0x000000010b0eac54 MimeParser.parseAlternative%%oo + 2676
11 com.mothsoftware.mailarchiverx 0x000000010b0e930c MimeParser.parseMime%%oo + 604
12 com.mothsoftware.mailarchiverx 0x000000010b0e67cd MimeParser.execute%%o + 2669
13 com.mothsoftware.mailarchiverx 0x000000010b0e577c MimeParser.Constructor%%osbA1o + 940
14 com.mothsoftware.mailarchiverx 0x000000010bab064d MailParser.parse%i8%o + 8717
15 com.mothsoftware.mailarchiverx 0x000000010bb91cd2 ArchiveThread.Archive%%o + 17970
16 com.mothsoftware.mailarchiverx 0x000000010bb89265 ArchiveThread.Event_Run%%o + 117
17 com.xojo.XojoFramework 0x000000010ddc6008 0x10db5d000 + 2527240
18 com.xojo.XojoFramework 0x000000010dc85fbb 0x10db5d000 + 1216443
19 libsystem_pthread.dylib 0x00007fff5d30e2eb _pthread_body + 126
20 libsystem_pthread.dylib 0x00007fff5d311249 _pthread_start + 66
21 libsystem_pthread.dylib 0x00007fff5d30d40d thread_start + 13

Does anyone have an idea what might cause this? Going to try MBS first.

Xojo 2019r1.1, 10.14.6.

Are you sure that there’s valid text being passed to encodeBase64?

I’m parsing emails. Who knows what sort of special data is in there?

Out of memory?

In 64bit? The user would have noticed that because for 64bit that kills the complete computer.

Looks like

StringOpsClassic::ConstructFromBuffer(char const*, unsigned int, int)

It works on bytes, not text, so it shouldn’t care.

ah - you didn’t say that your app was 64 bit (-:

Maybe some part of EncodeBase64 is not 64 bit clean and a ptr / length variable has overflowed 32 bits.