Commit 1b3cf18e authored by Sergei Golubchik's avatar Sergei Golubchik

CONNECT: accessed p[i] outside of the loop

this failed json.test on fulltest2 builder
parent 95dcfede
......@@ -1655,37 +1655,37 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
int i;
for (i = 0; i < np; i++)
p[i] = vp[i]->IsNull() ? NULL : vp[i]->GetCharString(val[i]);
if (p[i]) {
switch (op) {
case OP_CNC:
assert(np == 1 || np == 2);
if (vp[i]->IsNull())
return false;
else
p[i] = vp[i]->GetCharString(val[i]);
if (np == 2)
SetValue_psz(p[0]);
switch (op) {
case OP_CNC:
assert(np == 1 || np == 2);
if ((i = Len - (signed)strlen(Strp)) > 0)
strncat(Strp, p[np - 1], i);
if (np == 2)
SetValue_psz(p[0]);
break;
case OP_MIN:
assert(np == 2);
SetValue_psz((strcmp(p[0], p[1]) < 0) ? p[0] : p[1]);
break;
case OP_MAX:
assert(np == 2);
SetValue_psz((strcmp(p[0], p[1]) > 0) ? p[0] : p[1]);
break;
default:
// sprintf(g->Message, MSG(BAD_EXP_OPER), op);
strcpy(g->Message, "Function not supported");
return true;
} // endswitch op
if ((i = Len - (signed)strlen(Strp)) > 0)
strncat(Strp, p[np - 1], i);
Null = false;
} // endif p[i]
break;
case OP_MIN:
assert(np == 2);
SetValue_psz((strcmp(p[0], p[1]) < 0) ? p[0] : p[1]);
break;
case OP_MAX:
assert(np == 2);
SetValue_psz((strcmp(p[0], p[1]) > 0) ? p[0] : p[1]);
break;
default:
// sprintf(g->Message, MSG(BAD_EXP_OPER), op);
strcpy(g->Message, "Function not supported");
return true;
} // endswitch op
Null = false;
return false;
} // end of Compute
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment