Problem on 64 bit target
Brought to you by:
thanson
Hello everybody
I use TPL 1.2 between 64 bits and 32 bits targets.
size_t is on 64 eb so I made this fixe to avoid bad size value :
static int tpl_dump_to_mem(tpl_node r,void addr,size_t sz) {
uint32_t slen;
int fxlens, num_fxlens;
void dv;
char fmt,flags;
tpl_node c;
uint32_t sznew = sz; //<<<<< add cast to 32 eb >>>>>>
flags = 0;
if (tpl_cpu_bigendian()) flags |= TPL_FL_BIGENDIAN;
dv = addr;
dv = tpl_cpv(dv,TPL_MAGIC,3); /* copy tpl magic prefix */
dv = tpl_cpv(dv,&flags,1); /* copy flags byte */
dv = tpl_cpv(dv,&sznew,sizeof(uint32_t));/* overall length (inclusive) */ // <<<<<<< use the 32 bit SZ >>>
Thanks for this usefull layer
Alain
Anonymous
Logged In: NO
I forget my email : Alain.Bretaud@alcatel-lucent.fr