You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using this library for a while in a project of mine, and it's been working perfectly for me. However, recently, I pushed an update that broke in very specific scenarios. After debugging for ~3 hours, I was able to trace it to this library: as it turns out, tb64enc reads in past inlen, and writes to out past tb64enclen(inlen). An MRE is given below (compile this and the library with -fsanitize=address):
#include<turbob64.h>
#include<string.h>
#include<stdio.h>intmain(){
auto buf = newchar[128]; //For there to be no error, this needs to be at least 132auto data = newchar[94]; //For there to be no error, this needs to be at least 97memset(data, 0, 94);
for(int i=0; i< 128; i++){
printf("Length: %zu\n", tb64enclen(94));
tb64enc((unsignedchar*)data, 94, (unsignedchar*)buf);
}
}
The text was updated successfully, but these errors were encountered:
I've been using this library for a while in a project of mine, and it's been working perfectly for me. However, recently, I pushed an update that broke in very specific scenarios. After debugging for ~3 hours, I was able to trace it to this library: as it turns out,
tb64enc
readsin
pastinlen
, and writes toout
pasttb64enclen(inlen)
. An MRE is given below (compile this and the library with-fsanitize=address
):The text was updated successfully, but these errors were encountered: