Hi, i'm using the xyssl library to generate some hash's of a file, then there run through this function to convert to hex, before all of them being simultaneously being printed:
Code:
char *funcs_ustr2hex(unsigned char *sum)
{
int i;
int len = strlen((char*)sum);
char *sret="";
sret = (char *)malloc((len*2)+1);
//for( i = 0; i < len-1; i++ )
for( i = 0; i < 16; i++ )
sprintf( sret, "%s%02x", sret, sum[i] );
return sret;
}
my output looks like this:
Quote:
md5: ��X5dd39cab1c53c2c77cd352983f9641e1
md2: `�Xb5fcc4d4c05a2c6d25bda588c26663b0
md4: P�Xd4c5dab3ccfcc1d76d58382450f26ed2
|
I'm assuming it's this function because I don't yet do any conversion along the route (hence still unsigned), and these results look like memory problems.