initialize store_t::name

the field is marked foreign (for the drivers), so a recycled store may
contain an old pointer in it. that would make our error path crash.

REFMAIL: CAF_KswU7aBS7unnK+rdZy1PG_8SZUAW=tcg75HixDLLE0w3Lhw@mail.gmail.com
This commit is contained in:
Oswald Buddenhagen 2014-07-02 08:47:36 +02:00
parent 29b07ca7a6
commit 526231bc22

View File

@ -598,6 +598,7 @@ sync_boxes( store_t *ctx[], const char *names[], channel_conf_t *chan,
svars->uidval[0] = svars->uidval[1] = -1; svars->uidval[0] = svars->uidval[1] = -1;
svars->srecadd = &svars->srecs; svars->srecadd = &svars->srecs;
ctx[0]->name = ctx[1]->name = 0;
for (t = 0; t < 2; t++) { for (t = 0; t < 2; t++) {
ctx[t]->orig_name = ctx[t]->orig_name =
(!names[t] || (ctx[t]->conf->map_inbox && !strcmp( ctx[t]->conf->map_inbox, names[t] ))) ? (!names[t] || (ctx[t]->conf->map_inbox && !strcmp( ctx[t]->conf->map_inbox, names[t] ))) ?