Originally Posted by
awsdert
Either I didn't post that I eventually fixed the bug which turned out to be an unupdated variable used to fill the calculate the length (which caused only pieces of text to appear hence corruption) or you missed it, judging by how I can't find it despite remembering posting it I must've forgotten to post it. I did think it wierd how you seemed to be talking about a fixed bug, just didn't realise for sure until this post. Anyways thanks for the help, the current compile time bugs you mentioned are related to a new function I'm making that is going to process FPNs, I just haven't finished it yet cause I haven't quite identified what variables I need where and precisely how to handle them so I decided to make a small project on my computer to test on fixed FPNs with comparisons to FPNs cc creates, I have to do the math manually cause I plan to support base62 in FPNs also, it will surely pull interest from security companies at least who want to obfuscate their data and gcc developers will probably refuse to use it cause "it's not GPL!", *rolls eyes*.
Maybe it appears fixed, but it's not. The text isn't corrupted but there's still a bug
Code:
/* Should work yet somehow does not stop at '\0' like should */
((mcc_ch8_t*)(dstm->addr))[dstv->use * sizeof(mcc_ch8_t)] = 0; /* illegal write originating from here */
Code:
while ( (ret = mcc_gets(&src)) == EXIT_SUCCESS )
(void)printf( " '%s'", (char*)(src.text.vec.mem.addr) ); /* illegal read originating from here */
Code:
==29550== Invalid write of size 1
==29550== at 0x4046C8: mcc_getall (mcc_get.c:465)
==29550== by 0x404A79: mcc___gettext (mcc_get.c:529)
==29550== by 0x404B34: mcc__gettext (mcc_get.c:537)
==29550== by 0x404C39: mcc_ch8gettext (mcc_get.c:547)
==29550== by 0x406B18: mcc_gets (mcc_get.c:960)
==29550== by 0x407F76: _test (word.c:62)
==29550== by 0x40811E: main (word.c:100)
==29550== Address 0x4a56115 is 0 bytes after a block of size 21 alloc'd
==29550== at 0x483880B: malloc (vg_replace_malloc.c:309)
==29550== by 0x40729C: mcc_memsize (mcc_mem.c:57)
==29550== by 0x407689: mcc_vecsize (mcc_mem.c:125)
==29550== by 0x4044E8: mcc_getall (mcc_get.c:446)
==29550== by 0x404A79: mcc___gettext (mcc_get.c:529)
==29550== by 0x404B34: mcc__gettext (mcc_get.c:537)
==29550== by 0x404C39: mcc_ch8gettext (mcc_get.c:547)
==29550== by 0x406B18: mcc_gets (mcc_get.c:960)
==29550== by 0x407F76: _test (word.c:62)
==29550== by 0x40811E: main (word.c:100)
==29550==
==29550== Invalid read of size 1
==29550== at 0x483BBF4: strlen (vg_replace_strmem.c:461)
==29550== by 0x48D3A1D: __vfprintf_internal (in /usr/lib64/libc-2.29.so)
==29550== by 0x48BE38E: printf (in /usr/lib64/libc-2.29.so)
==29550== by 0x407F6A: _test (word.c:63)
==29550== by 0x40811E: main (word.c:100)
==29550== Address 0x4a56115 is 0 bytes after a block of size 21 alloc'd
==29550== at 0x483880B: malloc (vg_replace_malloc.c:309)
==29550== by 0x40729C: mcc_memsize (mcc_mem.c:57)
==29550== by 0x407689: mcc_vecsize (mcc_mem.c:125)
==29550== by 0x4044E8: mcc_getall (mcc_get.c:446)
==29550== by 0x404A79: mcc___gettext (mcc_get.c:529)
==29550== by 0x404B34: mcc__gettext (mcc_get.c:537)
==29550== by 0x404C39: mcc_ch8gettext (mcc_get.c:547)
==29550== by 0x406B18: mcc_gets (mcc_get.c:960)
==29550== by 0x407F76: _test (word.c:62)
==29550== by 0x40811E: main (word.c:100)
==29550==