Branch: Tag:

2014-12-04

2014-12-04 19:23:44 by Arne Goedeke <el@laramies.com>

F_ADD_LOCALS_AND_POP: fixed add when both strings are identical

527:    if( dsts->len && srcs->len )    {    size_t tmp = dsts->len; +  size_t tmp2 = srcs->len; +  /* +  * in case srcs==dsts +  * pike_string_cpy(MKPCHARP_STR_OFF(dsts,tmp), srcs); +  * does bad stuff +  */    dsts = new_realloc_shared_string( dsts, tmp+srcs->len, MAX(srcs->size_shift,dsts->size_shift) );    update_flags_for_add( dsts, srcs ); -  pike_string_cpy(MKPCHARP_STR_OFF(dsts,tmp), srcs); +  generic_memcpy(MKPCHARP_STR_OFF(dsts,tmp), MKPCHARP_STR(srcs), tmp2);    dst->u.string = low_end_shared_string( dsts );    }    else if( !dsts->len )