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) ...@@ -1655,37 +1655,37 @@ bool TYPVAL<PSZ>::Compute(PGLOBAL g, PVAL *vp, int np, OPVAL op)
int i; int i;
for (i = 0; i < np; i++) for (i = 0; i < np; i++)
p[i] = vp[i]->IsNull() ? NULL : vp[i]->GetCharString(val[i]); if (vp[i]->IsNull())
return false;
if (p[i]) { else
switch (op) { p[i] = vp[i]->GetCharString(val[i]);
case OP_CNC:
assert(np == 1 || np == 2);
if (np == 2) switch (op) {
SetValue_psz(p[0]); case OP_CNC:
assert(np == 1 || np == 2);
if ((i = Len - (signed)strlen(Strp)) > 0) if (np == 2)
strncat(Strp, p[np - 1], i); SetValue_psz(p[0]);
break; if ((i = Len - (signed)strlen(Strp)) > 0)
case OP_MIN: strncat(Strp, p[np - 1], i);
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; break;
} // endif p[i] 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; return false;
} // end of Compute } // 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