[SR-Users] weird dp_translate result

Juha Heinanen jh at tutpro.com
Sat Sep 1 12:24:40 CEST 2012


i think i found the bug that causes incorrect setting of dp_translate
attrs pvar value.

current code in dp_update function has this:

	no_change = (dest->type == PVT_NONE) || (!repl->s) || (!repl->len);

	if (no_change)
		goto set_attr_pvar;

	memset(&val, 0, sizeof(pv_value_t));
	val.flags = PV_VAL_STR;
	val.rs = *repl;

and then

set_attr_pvar:

	if(!attr_pvar)
		return 0;

	val.rs = *attrs;

if there is no change (like is the case in my failing test), val is not
initialized and its type can be anything.

i'll commit fix to trunk.  let me know if it looks ok, i'll pick it also
to 3.3.

-- juha



More information about the sr-users mailing list