idx
int64 0
522k
| project
stringclasses 631
values | commit_id
stringlengths 7
40
| project_url
stringclasses 630
values | commit_url
stringlengths 4
164
| commit_message
stringlengths 0
11.5k
| target
int64 0
1
| func
stringlengths 5
484k
| func_hash
float64 1,559,120,642,045,605,000,000,000B
340,279,892,905,069,500,000,000,000,000B
| file_name
stringlengths 4
45
| file_hash
float64 25,942,829,220,065,710,000,000,000B
340,272,304,251,680,200,000,000,000,000B
⌀ | cwe
sequencelengths 0
1
| cve
stringlengths 4
16
| cve_desc
stringlengths 0
2.3k
| nvd_url
stringlengths 37
49
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
520,314 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC FilesysTruncateCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
UdfGet(udf, _this, funcPtr);
Jsi_Value *vPos = Jsi_ValueArrayIndex(interp, args, 0);
Jsi_Number num;
if (Jsi_ValueGetNumber(interp, vPos, &num) != JSI_OK)
return JSI_ERROR;
num = (Jsi_Number)Jsi_Truncate(interp, udf->chan, (unsigned int)num);
Jsi_ValueMakeNumber(interp, ret, num);
return JSI_OK;
} | 61,399,374,702,538,000,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,315 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void dbEvalSetColumn(DbEvalContext *p, int iCol, Jsi_DString *dStr) {
Jsi_Interp *interp = p->jdb->interp;
char nbuf[JSI_MAX_NUMBER_STRING];
sqlite3_stmt *pStmt = p->pPreStmt->pStmt;
switch( sqlite3_column_type(pStmt, iCol) ) {
case SQLITE_BLOB: {
int bytes = sqlite3_column_bytes(pStmt, iCol);
const char *zBlob = (char*)sqlite3_column_blob(pStmt, iCol);
if( !zBlob ) {
return;
}
Jsi_DSAppendLen(dStr, zBlob, bytes);
return;
}
case SQLITE_INTEGER: {
sqlite_int64 v = sqlite3_column_int64(pStmt, iCol);
if (v==0 || v==1) {
const char *dectyp = sqlite3_column_decltype(pStmt, iCol);
if (dectyp && !Jsi_Strncasecmp(dectyp,"bool", 4)) {
Jsi_DSAppend(dStr, (v?"true":"false"), NULL);
return;
}
}
#ifdef __WIN32
snprintf(nbuf, sizeof(nbuf), "%" PRId64, (Jsi_Wide)v);
#else
snprintf(nbuf, sizeof(nbuf), "%lld", v);
#endif
Jsi_DSAppend(dStr, nbuf, NULL);
return;
}
case SQLITE_FLOAT: {
Jsi_NumberToString(interp, sqlite3_column_double(pStmt, iCol), nbuf, sizeof(nbuf));
Jsi_DSAppend(dStr, nbuf, NULL);
return;
}
case SQLITE_NULL: {
return;
}
}
const char *str = (char*)sqlite3_column_text(pStmt, iCol );
if (!str)
str = p->jdb->optPtr->nullvalue;
Jsi_DSAppend(dStr, str?str:"", NULL);
} | 298,905,477,875,784,000,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,316 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC jsiValueGetString(Jsi_Interp *interp, Jsi_Value* v, Jsi_DString *dStr, objwalker *owPtr)
{
char buf[JSI_MAX_NUMBER_STRING], *str;
Jsi_DString eStr;
Jsi_DSInit(&eStr);
if (interp->maxDepth>0 && owPtr->depth > interp->maxDepth)
return Jsi_LogError("recursive ToString");
int quote = owPtr->quote;
int isjson = owPtr->quote&JSI_OUTPUT_JSON;
Jsi_Number num;
switch(v->vt) {
case JSI_VT_UNDEF:
Jsi_DSAppend(dStr, "undefined", NULL);
return JSI_OK;
case JSI_VT_NULL:
Jsi_DSAppend(dStr, "null", NULL);
return JSI_OK;
case JSI_VT_VARIABLE:
Jsi_DSAppend(dStr, "variable", NULL);
return JSI_OK;
case JSI_VT_BOOL:
Jsi_DSAppend(dStr, (v->d.val ? "true":"false"), NULL);
return JSI_OK;
case JSI_VT_NUMBER:
num = v->d.num;
outnum:
if (isjson && !Jsi_NumberIsNormal(num)) {
Jsi_DSAppend(dStr, "null", NULL);
} else if (Jsi_NumberIsInteger(num)) {
Jsi_NumberItoA10((Jsi_Wide)num, buf, sizeof(buf));
Jsi_DSAppend(dStr, buf, NULL);
} else if (Jsi_NumberIsWide(num)) {
snprintf(buf, sizeof(buf), "%" PRId64, (Jsi_Wide)num);
Jsi_DSAppend(dStr, buf, NULL);
} else if (Jsi_NumberIsNormal(num) || Jsi_NumberIsSubnormal(num)) {
Jsi_NumberDtoA(interp, num, buf, sizeof(buf), 0);
Jsi_DSAppend(dStr, buf, NULL);
} else if (Jsi_NumberIsNaN(num)) {
Jsi_DSAppend(dStr, "NaN", NULL);
} else {
int s = Jsi_NumberIsInfinity(num);
if (s > 0) Jsi_DSAppend(dStr, "+Infinity", NULL);
else if (s < 0) Jsi_DSAppend(dStr, "-Infinity", NULL);
else Jsi_LogBug("Ieee function problem: %d", fpclassify(num));
}
return JSI_OK;
case JSI_VT_STRING:
str = v->d.s.str;
outstr:
if (!quote) {
Jsi_DSAppend(dStr, str, NULL);
return JSI_OK;
}
Jsi_DSAppend(dStr,"\"", NULL);
while (*str) {
if ((*str == '\'' && (!isjson)) || *str == '\\'|| *str == '\"'|| (*str == '\n'
&& (!(owPtr->quote&JSI_OUTPUT_NEWLINES)))
|| *str == '\r' || *str == '\t' || *str == '\f' || *str == '\b' ) {
char pcp[2];
*pcp = *str;
pcp[1] = 0;
Jsi_DSAppendLen(dStr,"\\", 1);
switch (*str) {
case '\r': *pcp = 'r'; break;
case '\n': *pcp = 'n'; break;
case '\t': *pcp = 't'; break;
case '\f': *pcp = 'f'; break;
case '\b': *pcp = 'b'; break;
}
Jsi_DSAppendLen(dStr,pcp, 1);
} else if (isprint(*str) || !isjson)
Jsi_DSAppendLen(dStr,str, 1);
else {
char ubuf[10];
int l = Jsi_UtfEncode(str, ubuf);
Jsi_DSAppend(dStr,ubuf, NULL);
str += l-1;
}
str++;
}
Jsi_DSAppend(dStr,"\"", NULL);
Jsi_DSFree(&eStr);
return JSI_OK;
case JSI_VT_OBJECT: {
Jsi_Obj *o = v->d.obj;
switch(o->ot) {
case JSI_OT_BOOL:
Jsi_DSAppend(dStr, (o->d.val ? "true":"false"), NULL);
return JSI_OK;
case JSI_OT_NUMBER:
num = o->d.num;
goto outnum;
return JSI_OK;
case JSI_OT_STRING:
str = o->d.s.str;
goto outstr;
case JSI_OT_FUNCTION:
Jsi_FuncObjToString(interp, o->d.fobj->func, &eStr, 3 | ((owPtr->depth==0 && owPtr->quote)?8:0));
str = Jsi_DSValue(&eStr);
goto outstr;
case JSI_OT_REGEXP:
str = o->d.robj->pattern;
goto outstr;
case JSI_OT_USEROBJ:
jsi_UserObjToName(interp, o->d.uobj, &eStr);
str = Jsi_DSValue(&eStr);
goto outstr;
case JSI_OT_ITER:
Jsi_DSAppend(dStr, (isjson?"null":"*ITER*"), NULL);
return JSI_OK;
default:
break;
}
if (o->isarrlist)
{
Jsi_Value *nv;
int i, len = o->arrCnt;
if (!o->arr)
len = Jsi_ValueGetLength(interp, v);
Jsi_DSAppend(dStr,"[",len?" ":"", NULL);
for (i = 0; i < len; ++i) {
nv = Jsi_ValueArrayIndex(interp, v, i);
if (i) Jsi_DSAppend(dStr,", ", NULL);
owPtr->depth++;
if (nv) {
if (jsiValueGetString(interp, nv, dStr, owPtr) != JSI_OK) {
owPtr->depth--;
return JSI_ERROR;
}
}
else Jsi_DSAppend(dStr, "undefined", NULL);
owPtr->depth--;
}
Jsi_DSAppend(dStr,len?" ":"","]", NULL);
} else {
int len = Jsi_TreeSize(o->tree);
Jsi_DSAppend(dStr,"{",len?" ":"", NULL);
owPtr->depth++;
Jsi_TreeWalk(o->tree, _object_get_callback, owPtr, 0);
owPtr->depth--;
Jsi_DSAppend(dStr,len?" ":"","}", NULL);
}
return JSI_OK;
}
#ifndef __cplusplus
default:
Jsi_LogBug("Unexpected value type: %d", v->vt);
#endif
}
return JSI_OK;
} | 226,257,690,058,301,750,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,317 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | int Jsi_Getc(Jsi_Interp *interp, Jsi_Channel chan) {
if (chan->fsPtr==0 || !chan->fsPtr->getcProc) return -1;
return chan->fsPtr->getcProc(chan);
} | 235,557,337,314,589,400,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,318 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | jsi_HashArrayFind( Jsi_Hash *tablePtr, const void *key)
{
jsi_Hash hval = jsi_HashArray(key, tablePtr->keyType);
size_t hindex = hval & tablePtr->mask;
Jsi_HashEntry *hPtr = tablePtr->buckets[hindex];
for (; hPtr != NULL; hPtr = hPtr->nextPtr)
if (hPtr->hval == hval && !memcmp(hPtr->key.string, key, tablePtr->keyType))
return hPtr;
return NULL;
} | 54,968,062,494,591,445,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,319 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | int Jsi_FunctionInvokeBool(Jsi_Interp *interp, Jsi_Value *func, Jsi_Value *arg)
{
if (interp->deleting)
return JSI_ERROR;
Jsi_Value *vpargs, *frPtr = Jsi_ValueNew1(interp);
Jsi_RC rc;
int bres = 0;
if (!arg) {
if (!interp->nullFuncArg) {
interp->nullFuncArg = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, NULL, 0, 0));
Jsi_IncrRefCount(interp, interp->nullFuncArg);
}
vpargs = interp->nullFuncArg;
} else {
vpargs = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, &arg, 1, 1));
}
Jsi_IncrRefCount(interp, vpargs);
rc = Jsi_FunctionInvoke(interp, func, vpargs, &frPtr, NULL);
Jsi_DecrRefCount(interp, vpargs);
if (rc == JSI_OK)
bres = Jsi_ValueIsTrue(interp, frPtr);
else {
bres = 2;
Jsi_LogError("function call failed");
}
Jsi_DecrRefCount(interp, frPtr);
if (Jsi_InterpGone(interp))
return JSI_ERROR;
return bres;
} | 313,010,202,717,338,000,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,320 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | char* Jsi_NumberToString(Jsi_Interp *interp, Jsi_Number d, char *buf, int bsiz)
{
if (Jsi_NumberIsInteger(d)) {
Jsi_NumberItoA10((Jsi_Wide)d, buf, bsiz);
} else if (Jsi_NumberIsNormal(d)) {
Jsi_NumberDtoA(interp, d, buf, bsiz, 0);
} else if (Jsi_NumberIsNaN(d)) {
Jsi_Strcpy(buf, "NaN");
} else {
int s = Jsi_NumberIsInfinity(d);
if (s > 0) Jsi_Strcpy(buf, "Infinity");
else if (s < 0) Jsi_Strcpy(buf, "-Infinity");
else {
buf[0] = 0;
}
}
return buf;
} | 289,335,747,163,288,900,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,321 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC SqliteConfCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
Jsi_Db *jdb, ojdb;
if (!(jdb = dbGetDbHandle(interp, _this, funcPtr))) return JSI_ERROR;
Jsi_Value *opts = Jsi_ValueArrayIndex(interp, args, 0);
if (jdb->noConfig && opts && !Jsi_ValueIsString(interp, opts))
return Jsi_LogError("Socket conf() is disabled for set");
ojdb = *jdb;
jdb->lastInsertId = sqlite3_last_insert_rowid(jdb->db);
jdb->changeCnt = sqlite3_changes(jdb->db);
jdb->changeCntAll = sqlite3_total_changes(jdb->db);
jdb->errorCode = sqlite3_errcode(jdb->db);
Jsi_RC rc = Jsi_OptionsConf(interp, SqlOptions, jdb, opts, ret, 0);
if (jdb->stmtCacheMax<0 || jdb->stmtCacheMax>MAX_PREPARED_STMTS) {
JSI_DBQUERY_PRINTF( "option stmtCacheMax value %d is not in range 0..%d", jdb->stmtCacheMax, MAX_PREPARED_STMTS);
jdb->stmtCacheMax = ojdb.stmtCacheMax;
rc = JSI_ERROR;
}
dbSetupCallbacks(jdb, &ojdb);
dbPrepStmtLimit(jdb);
return rc;
} | 53,332,894,608,792,680,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,322 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void Jsi_MutexDelete(Jsi_Interp *interp, Jsi_Mutex *mtx) { MutexDone(mtx); Jsi_Free(mtx);} | 41,195,178,268,837,050,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,323 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC WebSocketSendCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
jsi_wsCmdObj *cmdPtr = (jsi_wsCmdObj*)Jsi_UserObjGetData(interp, _this, funcPtr);
if (!cmdPtr)
return Jsi_LogError("Apply in a non-websock object");
WSSIGASSERT(cmdPtr, OBJ);
jsi_wsPss *pss;
Jsi_HashEntry *hPtr;
Jsi_HashSearch cursor;
Jsi_Value *arg = Jsi_ValueArrayIndex(interp, args, 1);
char *str = Jsi_ValueString(interp, arg, NULL);
int id = -1, argc = Jsi_ValueGetLength(interp, args);
Jsi_DString eStr = {};
if (argc!=2)
return Jsi_LogError("wrong args");
Jsi_Number dnum;
Jsi_Value *darg = Jsi_ValueArrayIndex(interp, args, 0);
if (Jsi_ValueGetNumber(interp, darg, &dnum) != JSI_OK)
return Jsi_LogError("invalid id");
id = (int)dnum;
if (!str)
str = (char*)Jsi_ValueGetDString(interp, arg, &eStr, JSI_OUTPUT_JSON);
if (cmdPtr->echo)
Jsi_LogInfo("WS-SEND: %s\n", str);
for (hPtr = Jsi_HashSearchFirst(cmdPtr->pssTable, &cursor);
hPtr != NULL; hPtr = Jsi_HashSearchNext(&cursor)) {
pss = (jsi_wsPss*)Jsi_HashValueGet(hPtr);
WSSIGASSERT(pss, PWS);
if ((id<0 || pss->wid == id) && pss->state != PWS_DEAD) {
if (!pss->stack)
pss->stack = Jsi_StackNew();
char *msg = (char*)Jsi_Malloc(LWS_PRE + Jsi_Strlen(str) + 1);
Jsi_Strcpy(msg + LWS_PRE, str);
Jsi_StackPush(pss->stack, msg);
pss->stats.msgQLen++;
if (!cmdPtr->echo && pss->echo)
Jsi_LogInfo("WS-SEND: %s\n", str);
}
}
Jsi_DSFree(&eStr);
return JSI_OK;
} | 272,709,287,518,638,180,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,324 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void fileObjErase(FileObj *fo)
{
if (fo->filename) {
Jsi_Close(fo->interp, fo->chan);
Jsi_Free(fo->filename);
Jsi_DecrRefCount(fo->interp, fo->fname);
Jsi_Free(fo->mode);
}
fo->filename = NULL;
} | 187,326,554,706,508,370,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,325 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_OpCodes *code_reserved(jsi_Pstate *p, jsi_Pline *line, int type, const char *id)
{
jsi_ReservedInfo *ri = (jsi_ReservedInfo*)Jsi_Calloc(1, sizeof(*ri));
ri->type = type;
ri->label = id;
ri->topop = 0;
JSI_NEW_CODESLN(1,OP_RESERVED, ri);
} | 143,260,171,090,451,820,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,326 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_RC jsi_StaticArgTypeCheck(Jsi_Interp *interp, int atyp, const char *p1, const char *p2, int index, Jsi_Func *func, jsi_Pline *line) {
Assert(index>0);
Jsi_RC rc;
if (interp->typeCheck.parse==0 && interp->typeCheck.all==0)
return JSI_OK;
int ai = index-1+func->callflags.bits.addargs;
if (func->argnames == NULL || ai>=func->argnames->count || ai<0)
return JSI_OK;
int typ = func->argnames->args[ai].type;
if (typ <= 0)
return JSI_OK;
if (index == 0 && func && func->type == FC_BUILDIN &&
interp->typeCheck.all==0) // Normally do not check return types for builtins.
return JSI_OK;
if ((typ&JSI_TT_ANY)) return JSI_OK;
if (index == 0 && atyp == JSI_VT_UNDEF) {
if (!(typ&JSI_TT_VOID))
goto done;
return JSI_OK;
}
/* if (index == 0 && (typ&JSI_TT_VOID)) {
if (atyp != JSI_VT_UNDEF && !(typ&JSI_TT_UNDEFINED))
goto done;
return JSI_OK;
}*/
if (atyp == JSI_VT_UNDEF)
return JSI_OK;
rc = JSI_OK;
if (typ&JSI_TT_UNDEFINED && atyp == JSI_TT_UNDEFINED) return rc;
if (typ&JSI_TT_NUMBER && atyp==JSI_TT_NUMBER) return rc;
if (typ&JSI_TT_STRING && atyp==JSI_TT_STRING) return rc;
if (typ&JSI_TT_BOOLEAN && atyp==JSI_TT_BOOLEAN) return rc;
if (typ&JSI_TT_ARRAY && atyp==JSI_TT_ARRAY) return rc;
if (typ&JSI_TT_FUNCTION && atyp==JSI_TT_FUNCTION) return rc;
if (typ&JSI_TT_REGEXP && atyp==JSI_TT_REGEXP) return rc;
if (typ&JSI_TT_USEROBJ && atyp==JSI_TT_USEROBJ) return rc;
if (typ&JSI_TT_ITEROBJ && atyp==JSI_TT_ITEROBJ) return rc;
if (typ&JSI_TT_OBJECT && atyp==JSI_TT_OBJECT) return rc;
if (typ&JSI_TT_NULL && atyp==JSI_TT_NULL) return rc;
done:
{
Jsi_DString dStr = {};
const char *exp = jsi_typeName(interp, typ, &dStr);
const char *vtyp = jsi_TypeName(interp, (Jsi_ttype)atyp);
char idxBuf[JSI_MAX_NUMBER_STRING*2];
idxBuf[0] = 0;
if (index>0)
snprintf(idxBuf, sizeof(idxBuf), " arg %d", index);
if (line)
interp->parseLine = line;
if (interp->typeCheck.error)
rc = JSI_ERROR;
jsi_TypeMismatch(interp);
Jsi_DString fStr = {};
rc = Jsi_LogType("type mismatch %s%s '%s': expected \"%s\" but got \"%s\"%s",
p1, idxBuf, p2, exp, vtyp, jsiFuncInfo(interp, &fStr, func, NULL));
Jsi_DSFree(&fStr);
Jsi_DSFree(&dStr);
}
return rc;
} | 296,488,900,189,650,850,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,327 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | int Jsi_SetChannelOption(Jsi_Interp *interp, Jsi_Channel chan, const char *optionName,
const char *newValue) {return JSI_OK;} | 299,256,704,320,597,460,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,328 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC InterpSourceCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
return InterpEvalCmd_(interp, args, _this, ret, funcPtr, 2);
} | 269,455,627,702,781,800,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,329 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | const char *jsiFuncInfo(Jsi_Interp *interp, Jsi_DString *dStr, Jsi_Func* func, Jsi_Value *arg) {
if (!func) return "";
if (func->name)
Jsi_DSPrintf(dStr, ", in call to '%s'", func->name);
else
Jsi_DSPrintf(dStr, ", in call to function");
if (func->script) {
const char *cp = Jsi_Strrchr(func->script, '/');
if (cp)
cp++;
else
cp = func->script;
Jsi_DSPrintf(dStr, " declared at %s:%d.%d", cp, func->bodyline.first_line, func->bodyline.first_column);
}
if (arg) {
Jsi_DSAppend(dStr, " <", NULL);
Jsi_ValueGetDString(interp, arg, dStr, 0);
Jsi_DSAppend(dStr, ">.", NULL);
}
return Jsi_DSValue(dStr);
} | 129,050,182,830,662,880,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,330 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC jsi_wsrecv_flush(jsi_wsCmdObj *cmdPtr, jsi_wsPss *pss)
{
int nlen = Jsi_DSLength(&pss->recvBuf);
if (nlen<=0)
return JSI_OK;
cmdPtr->recvBufCnt--;
const char *inPtr = Jsi_DSFreeDup(&pss->recvBuf);
Jsi_RC rc = jsi_wsrecv_callback(cmdPtr->interp, cmdPtr, pss, inPtr, nlen, 0);
if (rc != JSI_OK) {
pss->stats.recvErrCnt++;
pss->stats.recvErrLast = time(NULL);
}
return rc;
} | 332,669,761,537,871,830,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,331 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_RC Jsi_EvalCmdJSON(Jsi_Interp *interp, const char *cmd, const char *jsonArgs, Jsi_DString *dStr, int flags)
{
if (Jsi_MutexLock(interp, interp->Mutex) != JSI_OK)
return JSI_ERROR;
Jsi_Value *nrPtr = Jsi_ValueNew1(interp);
Jsi_RC rc = Jsi_CommandInvokeJSON(interp, cmd, jsonArgs, &nrPtr);
Jsi_DSInit(dStr);
Jsi_ValueGetDString(interp, nrPtr, dStr, flags /*JSI_OUTPUT_JSON*/);
Jsi_DecrRefCount(interp, nrPtr);
Jsi_MutexUnlock(interp, interp->Mutex);
return rc;
} | 140,076,748,110,181,910,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,332 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_OptionSpecsCached(Jsi_Interp *interp, const Jsi_OptionSpec *staticSpecs)
{
#ifdef NO_CACHED_SPECS
return (Jsi_OptionSpec*)staticSpecs;
#else
/* If we aren't master interp, need to cache due to init and modified flags if Jsi_OptionsChanged is called. */
if (interp->mainInterp == NULL) {
interp->mainInterp = interp;
}
if (interp == interp->mainInterp) {
return staticSpecs;
}
return jsi_GetCachedOptionSpecs(interp, staticSpecs);
#endif
} | 333,188,475,461,794,220,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,333 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC StringToLowerCaseCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
int sLen, bLen;
const char *vstr;
ChkString(_this, funcPtr, vstr, &sLen, &bLen);
Jsi_DString dStr;
Jsi_DSInit(&dStr);
jsi_utf_tocase(vstr, 0, &dStr);
Jsi_ValueFromDS(interp, &dStr, ret);
return JSI_OK;
} | 202,518,527,595,831,370,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,334 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_RC Jsi_GetDouble(Jsi_Interp* interp, const char *string, Jsi_Number *n)
{
char *endptr;
/* Callers can check for underflow via ERANGE */
errno = 0;
*n = strtod(string, &endptr);
return JsiCheckConversion(string, endptr);
} | 40,197,064,429,099,966,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,335 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void jsi_DumpCustomSpec(Jsi_Interp *interp, Jsi_Obj *nobj, Jsi_OptionSpec* spec)
{
Jsi_OptionCustom* cspec = Jsi_OptionCustomBuiltin(spec->custom);
void *data = spec->data;
if (cspec->help) {
if (Jsi_Strchr(cspec->help, '\n'))
Jsi_LogError("%s .help contains newline: %s", cspec->name, cspec->help);
Jsi_ObjInsert(interp, nobj, "help", Jsi_ValueNewStringKey(interp, cspec->help),0);
}
if (cspec->info)
Jsi_ObjInsert(interp, nobj, "info", Jsi_ValueNewStringKey(interp, cspec->info),0);
Jsi_ObjInsert(interp, nobj, "name", Jsi_ValueNewStringKey(interp, cspec->name),0);
if (data && (spec->custom == Jsi_Opt_SwitchEnum || spec->custom == Jsi_Opt_SwitchBitset)) {
Jsi_Obj *sobj = Jsi_ObjNewType(interp, JSI_OT_ARRAY);
Jsi_Value *svalue = Jsi_ValueMakeObject(interp, NULL, sobj);
const char **lst = jsi_OptGetEnumList(spec);
int i = 0;
while (lst[i]) {
Jsi_ObjArrayAdd(interp, sobj, Jsi_ValueNewStringKey(interp, lst[i]));
i++;
}
Jsi_ObjInsert(interp, nobj, (spec->custom == Jsi_Opt_SwitchBitset?"bitSet":"enumList"), svalue, 0);
} else if (spec->custom == Jsi_Opt_SwitchSuboption) {
Jsi_OptionSpec* subSpec = (Jsi_OptionSpec*)data;
Jsi_Obj *sobj = Jsi_ObjNewType(interp, JSI_OT_ARRAY);
Jsi_Value *svalue = Jsi_ValueMakeObject(interp, NULL, sobj);
jsi_DumpOptionSpecs(interp, sobj, subSpec);
Jsi_ObjInsert(interp, nobj, "subSpec", svalue, 0);
}
} | 209,212,612,734,798,940,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,336 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | const char *jsi_GetHomeDir(Jsi_Interp *interp) {
const char *str = NULL;
if (interp->homeDir)
return interp->homeDir;
#ifdef __WIN32
str = getenv("USERPROFILE"); /* TODO: windows home dir. */
#else
if ((str = getenv("HOME")) == NULL) {
struct passwd pwd, *pw;
char buf[JSI_BUFSIZ*3];
if (getpwuid_r(getuid(), &pwd, buf, sizeof(buf), &pw) == 0 && pw->pw_dir)
str = pw->pw_dir;
}
#endif
if (!str) {
Jsi_LogBug("no home dir");
str = "/";
}
#ifdef JSI_LITE_ONLY
return str;
#else
return (interp->homeDir = Jsi_KeyAdd(interp, str));
#endif
} | 159,567,105,146,015,400,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,337 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_ScopeStrs *jsi_ScopeStrsDup(jsi_Pstate *ps, Jsi_ScopeStrs *ss)
{
Jsi_ScopeStrs *n = jsi_ScopeStrsNew();
int i;
if (!ss) return n;
*n = *ss;
if (!ss->args) return n;
n->args = (jsi_ArgValue*)Jsi_Calloc(n->count, sizeof(ss->args[0]));
n->_size = n->count;
memcpy(n->args, ss->args, (n->count * sizeof(ss->args[0])));
for (i = 0; i < ss->count; ++i) {
if (ss->args[i].defValue)
Jsi_IncrRefCount(ps->interp, ss->args[i].defValue);
}
return n;
} | 151,950,114,848,858,750,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,338 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC interpObjFree(Jsi_Interp *interp, void *data)
{
InterpObj *fo = (InterpObj *)data;
SIGASSERT(fo,INTERPOBJ);
if (fo->deleting) return JSI_OK;
fo->deleting = 1;
interpObjErase(fo);
Jsi_Free(fo);
return JSI_OK;
} | 94,529,600,798,831,900,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,339 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_RC Jsi_GetInt(Jsi_Interp* interp, const char *string, int *n, int base)
{
char *endptr;
if (base) {
*n = strtoul(string, &endptr, base);
}
else {
*n = (int)jsi_strtoul(string, &endptr);
}
return JsiCheckConversion(string, endptr);
} | 338,258,326,960,180,750,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,340 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC jsi_ValueToParentFunc(Jsi_Interp *interp, Jsi_OptionSpec* spec, Jsi_Value *inValue, const char *inStr, void *record, Jsi_Wide flags)
{
if (inStr)
return JSI_ERROR;
Jsi_Value *val;
Jsi_Value **v = (Jsi_Value **)(((char*)record) + spec->offset);
const char *s, *subspec = (const char *)spec->data;
Jsi_Interp *pinterp = interp->parent;
if (!pinterp)
return Jsi_LogError("no parent interp");
if (!subspec)
return Jsi_LogError("custom parentfunc spec did not set data: %s", spec->name);
if (!inValue || Jsi_ValueIsNull(interp, inValue)) {
if (*v) Jsi_DecrRefCount(pinterp, *v);
*v = NULL;
return JSI_OK;
}
if (!(s=Jsi_ValueString(interp, inValue, NULL))) {
return Jsi_LogError("expected string or null");
}
val = Jsi_NameLookup(pinterp, s);
if (!val)
return Jsi_LogError("value not found in parent: %s", s);
if (!Jsi_ValueIsFunction(pinterp, val))
return Jsi_LogError("expected a func value");
if (spec->data && (interp->strict || pinterp->strict))
if (!jsi_FuncIsNoop(pinterp, val)
&& !jsi_FuncArgCheck(pinterp, val->d.obj->d.fobj->func, (char*)spec->data))
return Jsi_LogError("failed setting func pointer for %s", spec->name);
*v = val;
Jsi_IncrRefCount(pinterp, val);
return JSI_OK;
} | 222,447,829,722,246,180,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,341 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC jsi_ValueToSubopt(Jsi_Interp *interp, Jsi_OptionSpec* spec, Jsi_Value *inValue, const char *inStr, void *record, Jsi_Wide flags)
{
if (inStr)
return JSI_ERROR;
char *s = ((char*)record) + spec->offset;
Jsi_OptionSpec *subspec = (Jsi_OptionSpec *)spec->data;
if (spec == subspec)
return Jsi_LogError("subspec was recursive");
if (!subspec)
return Jsi_LogError("custom suboption spec did not set data: %s", spec->name);
if (inValue && Jsi_ValueIsNull(interp, inValue) == 0 &&
(Jsi_ValueIsObjType(interp, inValue, JSI_OT_OBJECT)==0 || inValue->d.obj->isarrlist))
return Jsi_LogError("expected object");
return (Jsi_OptionsProcess(interp, subspec, s, inValue, flags)<0 ? JSI_ERROR : JSI_OK);
} | 186,693,222,109,709,740,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,342 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_Value* Jsi_ValueMakeNumber(Jsi_Interp *interp, Jsi_Value **vPtr, Jsi_Number n) {
Jsi_Value *v = (vPtr?*vPtr:NULL);
if (!v)
v = Jsi_ValueNew(interp);
else
Jsi_ValueReset(interp, vPtr);
v->vt = JSI_VT_NUMBER;
v->d.num = n;
return v;
} | 212,562,754,135,782,000,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,343 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void DbClose(sqlite3 *db) {
sqlite3_close(db);
} | 109,445,210,338,208,310,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,344 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC InterpEvalCmd_(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr, int flags)
{
int isFile = flags&2;
int isUplevel = flags&1;
int lev = 0;
bool async = 0;
Jsi_RC rc = JSI_OK;
int isthrd;
Jsi_Interp *sinterp = interp;
Jsi_ValueMakeUndef(interp, ret);
InterpObj *udf = (InterpObj *)Jsi_UserObjGetData(interp, _this, funcPtr);
if (udf)
sinterp = udf->subinterp;
if (Jsi_InterpGone(interp) || Jsi_InterpGone(sinterp))
return Jsi_LogError("Sub-interp gone");
isthrd = (interp->threadId != sinterp->threadId);
jsi_Frame *f = sinterp->framePtr;
Jsi_Value *nw = Jsi_ValueArrayIndex(interp, args, 1);
if (!isUplevel) {
if (nw && Jsi_GetBoolFromValue(interp, nw, &async))
return JSI_ERROR;
} else {
if (isthrd)
return Jsi_LogError("can not use uplevel() with threaded interp");
Jsi_Number nlev = sinterp->framePtr->level;
if (nw && Jsi_GetNumberFromValue(interp, nw, &nlev)!=JSI_OK)
return Jsi_LogError("expected number");
lev = (int)nlev;
if (lev <= 0)
lev = f->level+lev;
if (lev <= 0 || lev > f->level)
return Jsi_LogError("level %d not between 1 and %d", (int)nlev, f->level);
}
char *cp = Jsi_ValueArrayIndexToStr(interp, args, 0, NULL);
if (cp==NULL || *cp == 0)
return JSI_OK;
if (async && isthrd) {
/* Post to thread event in sub-interps queue. TODO: could just use event like below... */
if (Jsi_MutexLock(interp, sinterp->QMutex) != JSI_OK)
return JSI_ERROR;
Jsi_DSAppend(&sinterp->interpEvalQ, Jsi_Strlen(Jsi_DSValue(&sinterp->interpEvalQ))?";":"", cp, NULL);
Jsi_MutexUnlock(interp, sinterp->QMutex);
return JSI_OK;
}
if (interp->subOpts.mutexUnlock) Jsi_MutexUnlock(interp, interp->Mutex);
if (!isthrd) {
int ostrict = sinterp->strict;
sinterp->strict = 0;
sinterp->level++;
if (interp->framePtr->tryDepth)
sinterp->framePtr->tryDepth++;
if (isFile) {
int sflags = 0;
if (!sinterp->includeCnt) {
sflags = JSI_EVAL_ARGV0|JSI_EVAL_AUTOINDEX;
sinterp->isMain = 1;
}
if (sinterp->debugOpts.debugCallback && !sinterp->includeCnt) // TODO: safe debugging can't use "source"
// TODO: we do this in debugger, even though it is illegal for interps to share objects.
sinterp->autoFiles = Jsi_ValueDup(sinterp, interp->autoFiles);
sinterp->includeCnt++;
rc = Jsi_EvalFile(sinterp, Jsi_ValueArrayIndex(interp, args, 0), sflags);
} else if (isUplevel == 0 || lev <= 1)
rc = (Jsi_EvalString(sinterp, cp, 0) == 0 ? JSI_OK : JSI_ERROR);
else {
rc = (jsi_evalStrFile(sinterp, NULL, cp, 0, lev) == 0 ? JSI_OK : JSI_ERROR);
}
sinterp->strict = ostrict;
if (interp->framePtr->tryDepth) {
sinterp->framePtr->tryDepth--;
if (rc != JSI_OK && interp != sinterp) {
Jsi_Strcpy(interp->errMsgBuf, sinterp->errMsgBuf);
interp->errLine = sinterp->errLine;
interp->errFile = sinterp->errFile;
sinterp->errMsgBuf[0] = 0;
}
}
sinterp->level--;
} else {
if (Jsi_MutexLock(interp, sinterp->QMutex) != JSI_OK)
return JSI_ERROR;
InterpStrEvent *se, *s = (InterpStrEvent *)Jsi_Calloc(1, sizeof(*s));
SIGINIT(s,INTERPSTREVENT);
s->isExec = 1;
s->tryDepth = interp->framePtr->tryDepth;
Jsi_DSInit(&s->data);
Jsi_DSAppend(&s->data, cp, NULL);
Jsi_DSInit(&s->func);
//s->mutex = Jsi_MutexNew(interp, -1, JSI_MUTEX_RECURSIVE);
//Jsi_MutexLock(s->mutex);
se = sinterp->interpStrEvents;
if (!se)
sinterp->interpStrEvents = s;
else {
while (se->next)
se = se->next;
se->next = s;
}
Jsi_MutexUnlock(interp, sinterp->QMutex);
while (s->isExec) /* Wait until done. TODO: timeout??? */
Jsi_Sleep(interp, 1);
rc = (s->rc == 0 ? JSI_OK : JSI_ERROR);
if (rc != JSI_OK)
Jsi_LogError("eval failed: %s", Jsi_DSValue(&s->data));
Jsi_DSFree(&s->func);
Jsi_DSFree(&s->data);
Jsi_Free(s);
}
if (interp->subOpts.mutexUnlock && Jsi_MutexLock(interp, interp->Mutex) != JSI_OK) {
return JSI_ERROR;
}
if (Jsi_InterpGone(sinterp))
{
/* TODO: perhaps exit() be able to delete. */
//Jsi_InterpDelete(sinterp);
return JSI_OK;
}
/*if (rc != JSI_OK && !async)
return rc;*/
if (sinterp->retValue->vt != JSI_VT_UNDEF) {
if (sinterp == interp)
Jsi_ValueCopy(interp, *ret, sinterp->retValue);
else
Jsi_CleanValue(sinterp, interp, sinterp->retValue, ret);
}
return rc;
} | 177,072,983,514,314,900,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,345 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void delete_case5(Jsi_TreeEntry* n) {
Jsi_TreeEntry* s = sibling(n);
if (node_color(s) == _JSI_TREE_BLACK ) {
if (n == n->parent->left &&
node_color(s->right) == _JSI_TREE_BLACK &&
node_color(s->left) == _JSI_TREE_RED)
{
set_color(s, _JSI_TREE_RED);
set_color(s->left, _JSI_TREE_BLACK);
rotate_right(s);
}
else if (n == n->parent->right &&
node_color(s->right) == _JSI_TREE_RED &&
node_color(s->left) == _JSI_TREE_BLACK)
{
set_color(s, _JSI_TREE_RED);
set_color(s->right, _JSI_TREE_BLACK);
rotate_left(s);
}
}
delete_case6(n);
} | 315,733,872,620,513,900,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,346 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void Jsi_NumberDtoA(Jsi_Interp *interp, Jsi_Number value, char* buf, int bsiz, int prec)
{
int dp = interp->subOpts.dblPrec-1, dm = __DBL_DECIMAL_DIG__;
if (prec==0)
prec = (dp<=0?dm+dp:dp);
else if (prec<0)
prec = dm+prec;
if (prec<=0)
prec = dm-1;
if (Jsi_NumberIsNaN(value))
Jsi_Strcpy(buf,"NaN");
else
snprintf(buf, bsiz, "%.*" JSI_NUMGFMT, prec, value);
} | 167,366,751,584,945,130,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,347 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | int Jsi_AddAutoFiles(Jsi_Interp *interp, const char *dir) {
Jsi_DString dStr = {};
Jsi_StatBuf stat;
int i, cnt = 0;
for (i=0; i<2; i++) {
Jsi_DSAppend(&dStr, dir, (i==0?"/lib":""),"/autoload.jsi", NULL);
Jsi_Value *v = Jsi_ValueNewStringKey(interp, Jsi_DSValue(&dStr));
if (Jsi_Stat(interp, v, &stat) != 0)
Jsi_ValueFree(interp, v);
else {
if (!interp->autoFiles) {
interp->autoFiles = Jsi_ValueNewArray(interp, 0, 0);
Jsi_IncrRefCount(interp, interp->autoFiles);
}
Jsi_ObjArrayAdd(interp, interp->autoFiles->d.obj, v);
cnt++;
interp->autoLoaded = 0;
}
Jsi_DSSetLength(&dStr, 0);
}
Jsi_DSFree(&dStr);
return cnt;
} | 149,929,227,330,811,120,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,348 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC SqliteCollateCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
Jsi_Db *jdb;
Jsi_Value *func;
SqlCollate *pCollate;
char *zName;
if (!(jdb = dbGetDbHandle(interp, _this, funcPtr))) return JSI_ERROR;
zName = Jsi_ValueArrayIndexToStr(interp, args, 0, NULL);
func = Jsi_ValueArrayIndex(interp, args, 1);
pCollate = (SqlCollate*)Jsi_Calloc(1, sizeof(*pCollate));
if( pCollate==0 ) return JSI_ERROR;
pCollate->jdb = jdb;
pCollate->interp = interp;
pCollate->pNext = jdb->pCollate;
pCollate->zScript = func; /*(char*)&pCollate[1];*/
jdb->pCollate = pCollate;
if( sqlite3_create_collation(jdb->db, zName, SQLITE_UTF8, pCollate, dbSqlCollate) )
return Jsi_LogError("%s", (char *)sqlite3_errmsg(jdb->db));
return JSI_OK;
} | 126,621,530,751,159,820,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,349 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_Value *Jsi_VarLookup(Jsi_Interp *interp, const char *varname)
{
Jsi_Value *v;
v = Jsi_ValueObjLookup(interp, interp->framePtr->incsc, (char*)varname, 0);
if (!v)
v = jsi_ScopeChainObjLookupUni(interp->framePtr->ingsc, (char*)varname);
return v;
} | 203,673,781,009,934,470,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,350 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_RC jsi_InitTree(Jsi_Interp *interp, int release)
{
if (release) return JSI_OK;
/* TODO: maintain hash table of trees created per interp? */
return JSI_OK;
} | 86,035,918,444,809,000,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,351 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_Value * jsi_FSListVolumesProc(Jsi_Interp *interp) {return 0;} | 312,523,145,558,706,500,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,352 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC SqliteFilenameCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
#if (SQLITE_VERSION_NUMBER>3007009)
const char *zName = "main";
int argc = Jsi_ValueGetLength(interp, args);
Jsi_Db *jdb;
if (!(jdb = dbGetDbHandle(interp, _this, funcPtr))) return JSI_ERROR;
if (argc)
zName = Jsi_ValueArrayIndexToStr(interp, args, 0, NULL);
zName = sqlite3_db_filename(jdb->db, zName);
if (zName)
Jsi_ValueMakeStringDup(interp, ret, zName);
#endif
return JSI_OK;
} | 267,507,052,844,487,650,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,353 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC dbTransPostCmd(
Jsi_Db *jdb, /* Sqlite3Db for $db */
Jsi_Interp *interp, /* Jsi interpreter */
Jsi_RC result /* Result of evaluating SCRIPT */
) {
static const char *azEnd[] = {
"RELEASE _jsi_transaction", /* rc==JSI_ERROR, nTransaction!=0 */
"COMMIT", /* rc!=JSI_ERROR, nTransaction==0 */
"ROLLBACK TO _jsi_transaction ; RELEASE _jsi_transaction",
"ROLLBACK" /* rc==JSI_ERROR, nTransaction==0 */
};
Jsi_RC rc = result;
const char *zEnd;
jdb->nTransaction--;
zEnd = azEnd[(rc==JSI_ERROR)*2 + (jdb->nTransaction==0)];
jdb->disableAuth++;
if( sqlite3_exec(jdb->db, zEnd, 0, 0, 0)) {
/* This is a tricky scenario to handle. The most likely cause of an
** error is that the exec() above was an attempt to commit the
** top-level transaction that returned SQLITE_BUSY. Or, less likely,
** that an IO-error has occured. In either case, throw a Jsi exception
** and try to rollback the transaction.
**
** But it could also be that the user executed one or more BEGIN,
** COMMIT, SAVEPOINT, RELEASE or ROLLBACK commands that are confusing
** this method's logic. Not clear how this would be best handled.
*/
if( rc!=JSI_ERROR ) {
Jsi_LogError("%s", sqlite3_errmsg(jdb->db));
rc = JSI_ERROR;
}
sqlite3_exec(jdb->db, "ROLLBACK", 0, 0, 0);
}
jdb->disableAuth--;
return rc;
} | 130,295,847,392,832,390,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,354 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC dbEvalInit(
Jsi_Interp *interp,
DbEvalContext *p, /* Pointer to structure to initialize */
Jsi_Db *jdb, /* Database handle */
const char* zSql, /* Value containing SQL script */
Jsi_DString *dStr,
Jsi_Obj *pArray, /* Name of Jsi array to set (*) element of */
Jsi_Obj *pValVar /* Name element in array for list. */
) {
p->dSql = dStr;
p->zSql = Jsi_DSAppend(p->dSql, zSql?zSql:"", NULL);
p->jdb = jdb;
return JSI_OK;
} | 126,632,844,720,595,000,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,355 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_DbQuery(Jsi_Db *jdb, Jsi_CDataDb *dPtr, const char *query)
{
if (!jsi_dbVfsPtr) {
printf( "Sqlite unsupported\n");
return -1;
}
return jsi_dbVfsPtr->dbcQuery(jdb, dPtr, query);
} | 149,943,136,004,767,420,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,356 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_OpCodes *code_jtrue_np(int off) { JSI_NEW_CODES(0,OP_JTRUE_NP, off); } | 312,701,622,801,500,020,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,357 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | const char* Jsi_KeyAdd(Jsi_Interp *interp, const char *str)
{
Jsi_MapEntry *hPtr;
bool isNew;
hPtr = Jsi_MapEntryNew(interp->strKeyTbl, str, &isNew);
assert(hPtr) ;
return (const char*)Jsi_MapKeyGet(hPtr, 0);
} | 192,334,686,286,645,900,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,358 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int codes_insert(Jsi_OpCodes *c, jsi_Eopcode code, void *extra, int doalloc)
{
if (c->code_size - c->code_len <= 0) {
c->code_size += 100;
c->codes = (jsi_OpCode *)Jsi_Realloc(c->codes, c->code_size * sizeof(jsi_OpCode));
}
c->codes[c->code_len].op = code;
c->codes[c->code_len].data = extra;
c->codes[c->code_len].alloc = doalloc;
c->code_len ++;
return 0;
} | 235,543,814,781,671,170,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,359 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_DbQuery(Jsi_Db *jdb, Jsi_CDataDb *dbopts, const char *query)
{
int rc = jsi_DbQuery(jdb, dbopts, query);
#ifdef JSI_DBQUERY_ERRORCMD
if (rc<0)
rc = JSI_DBQUERY_ERRORCMD(jdb, specs, data, arrSize, query, dopts, rc);
#endif
return rc;
} | 291,627,309,787,524,140,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,360 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_TreeEntry *Jsi_TreeEntryNew(Jsi_Tree *treePtr, const void *key, bool *isNew)
{
Jsi_TreeEntry* hPtr;
bool isn;
if (treePtr->flags.destroyed)
return NULL;
if (treePtr->opts.lockTreeProc && (*treePtr->opts.lockTreeProc)(treePtr, 1) != JSI_OK)
return NULL;
treePtr->flags.inserting=1;
if (treePtr->flags.internstr) {
Assert(treePtr->keyType == JSI_KEYS_STRINGKEY);
if (!treePtr->strHash)
treePtr->strHash = Jsi_HashNew(treePtr->opts.interp, JSI_KEYS_STRING, NULL);
key = Jsi_HashEntryNew(treePtr->strHash, key, NULL);
}
hPtr = treePtr->createProc(treePtr, key, &isn);
if (isNew)
*isNew = isn;
if (isn == 0 || treePtr->flags.nonredblack == 1 || !hPtr) {
treePtr->flags.inserting=0;
goto done;
}
treePtr->epoch++;
hPtr->f.bits.color = _JSI_TREE_RED;
if (treePtr->root == NULL) {
treePtr->root = hPtr;
} else {
Jsi_TreeEntry* n = treePtr->root;
while (1) {
int rc = treePtr->opts.compareTreeProc(treePtr, Jsi_TreeKeyGet(n) , key);
if (rc == 0) {
Assert(0);
} else if (rc < 0) {
if (n->left == NULL) {
n->left = hPtr;
break;
} else {
n = n->left;
}
} else {
if (n->right == NULL) {
n->right = hPtr;
break;
} else {
n = n->right;
}
}
}
hPtr->parent = n;
}
insert_case1(hPtr);
treePtr->flags.inserting = 0;
done:
if (treePtr->opts.lockTreeProc)
(*treePtr->opts.lockTreeProc)(treePtr, 0);
return hPtr;
} | 329,306,655,916,816,330,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,361 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC jsi_wsFileAdd(Jsi_Interp *interp, jsi_wsCmdObj *cmdPtr, Jsi_Value *name) {
const char *sname = Jsi_ValueString(interp, name, NULL);
if (cmdPtr->onModify && sname) {
bool isNew = 0;
Jsi_HashEntry *hPtr = Jsi_HashEntryNew(cmdPtr->fileHash, sname, &isNew);
if (hPtr) {
jsi_wsFile* fPtr;
if (!isNew)
fPtr = Jsi_HashValueGet(hPtr);
else {
fPtr = (jsi_wsFile *)Jsi_Calloc(1, sizeof(*fPtr));
fPtr->fileVal = name;
fPtr->loadFirst = time(NULL);
Jsi_IncrRefCount(interp, name);
fPtr->flags = 0;
Jsi_HashValueSet(hPtr, fPtr);
}
fPtr->loadLast = time(NULL);
}
}
return JSI_OK;
} | 168,304,089,904,530,700,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,362 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void jsi_AddEventHandler(Jsi_Interp *interp)
{
Jsi_Event *ev;
while (!interp->EventHdlId) { /* Find an empty event slot. */
bool isNew;
uintptr_t id = ++interp->eventIdx;
Jsi_HashEntry *hPtr = Jsi_HashEntryNew(interp->eventTbl, (void*)id, &isNew);
if (!isNew)
continue;
ev = (Jsi_Event*)Jsi_Calloc(1, sizeof(*ev));
SIGINIT(ev,EVENT);
ev->id = id;
ev->handler = ThreadEvalCallback;
ev->hPtr = hPtr;
ev->evType = JSI_EVENT_ALWAYS;
Jsi_HashValueSet(hPtr, ev);
interp->EventHdlId = id;
}
} | 89,670,860,286,294,480,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,363 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_HashNew(Jsi_Interp *interp, unsigned int keyType, Jsi_HashDeleteProc freeProc)
{
Jsi_Hash *tablePtr = (Jsi_Hash*)Jsi_Calloc(1,sizeof(*tablePtr));
SIGINIT(tablePtr, HASH);
tablePtr->opts.mapType = (Jsi_Map_Type)JSI_MAP_HASH;
tablePtr->typ = JSI_MAP_HASH;
tablePtr->opts.interp = interp;
tablePtr->buckets = tablePtr->staticBuckets;
#if !(JSI_SMALL_HASH_TABLE && !(JSI_SMALL_HASH_TABLE & (JSI_SMALL_HASH_TABLE - 1)))
#error "small hash must be a power of two"
#endif
tablePtr->numBuckets = JSI_SMALL_HASH_TABLE;
tablePtr->rebuildSize = JSI_SMALL_HASH_TABLE * REBUILD_MULTIPLIER;
tablePtr->downShift = DOWNSHIFT_START;
tablePtr->opts.freeHashProc = freeProc;
tablePtr->mask = (jsi_Hash)(tablePtr->numBuckets - 1);
tablePtr->opts.keyType = (Jsi_Key_Type)keyType;
tablePtr->keyType = (Jsi_Key_Type)keyType;
switch (keyType) {
case JSI_KEYS_STRING: /* NUL terminated string keys. */
tablePtr->findProc = HashStringFind;
tablePtr->createProc = HashStringCreate;
break;
case JSI_KEYS_STRINGKEY: /* Lookup from another String hash, eg. Jsi_KeyAdd() */
case JSI_KEYS_ONEWORD: /* A pointer. */
tablePtr->findProc = HashOneWordFind;
tablePtr->createProc = HashOneWordCreate;
break;
default: /* Structs. */
if (keyType < JSI_KEYS_STRUCT_MINSIZE) {
Jsi_LogError("Jsi_HashNew: Key size can't be %d, must be >= %d", keyType, JSI_KEYS_STRUCT_MINSIZE);
Jsi_Free(tablePtr);
return NULL;
}
tablePtr->findProc = jsi_HashArrayFind;
tablePtr->createProc = jsi_HashArrayCreate;
break;
}
return tablePtr;
} | 138,931,900,379,917,160,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,364 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_RC Jsi_initSqlite(Jsi_Interp *interp, int release)
{
if (!release) Jsi_InterpSetData(interp, JSI_SQLITE_DB_VFS, &jsi_dbVfsPtr, NULL);
return JSI_OK;
} | 160,639,822,959,616,500,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,365 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void jsi_ValueCopyMove(Jsi_Interp *interp, Jsi_Value *to, Jsi_Value *from, int isCopy ) {
if (!from) {
Jsi_ValueMakeUndef(interp, &to);
return;
}
VALCHK(from);
if( to == from) return;
int ocnt = to->refCnt;
Jsi_Value *ovt = NULL;
assert(ocnt>0);
int toVt = to->vt;
if (toVt == JSI_VT_VARIABLE) {
ovt = to->d.lval;
Jsi_IncrRefCount(interp, ovt);
}
Jsi_ValueMakeUndef(interp, &to);
#ifdef JSI_MEM_DEBUG
memcpy(to, from, sizeof(*to)-sizeof(to->VD));
to->VD.label3 = from->VD.func;
#else
*to = *from;
#endif
if (isCopy) {
if (to->refCnt) {
switch (to->vt) {
case JSI_VT_STRING:
if (!to->f.bits.isstrkey) {
to->d.s.str = Jsi_StrdupLen(to->d.s.str, to->d.s.len);
}
break;
case JSI_VT_OBJECT:
Jsi_ObjIncrRefCount(interp,to->d.obj);
break;
case JSI_VT_VARIABLE:
Jsi_IncrRefCount(interp,to->d.lval);
break;
default:
break;
}
}
to->refCnt = ocnt;
if (ovt)
Jsi_DecrRefCount(interp, ovt);
} else {
to->refCnt = ocnt;
if (ovt)
Jsi_DecrRefCount(interp, ovt);
ocnt = from->refCnt;
#ifdef JSI_MEM_DEBUG
memset(from, 0, sizeof(*to)-sizeof(to->VD));
#else
memset(from, 0, sizeof(*to));
#endif
SIGINIT(from, VALUE);
from->refCnt = ocnt;
}
} | 123,841,560,707,779,020,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,366 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int jsi_wsHttp(Jsi_Interp *interp, jsi_wsCmdObj *cmdPtr, struct lws *wsi, void *user,
struct lws_context *context, const char* inPtr, Jsi_DString *tStr, jsi_wsPss *pss)
{
const char *ext = NULL;
unsigned char buffer[JSI_BUFSIZ];
const char *mime = NULL;
time_t now = time(NULL);
char buf[JSI_BUFSIZ];
int rc = 0;
buf[0] = 0;
uchar *p = buffer, *end = &buffer[sizeof(buffer)-1];
int n;
Jsi_Value* fname = NULL;
bool isJsiWeb = 0, isSSI = 0;
cmdPtr->stats.httpLast = now;
/* if a legal POST URL, let it continue and accept data */
if (lws_hdr_total_length(wsi, WSI_TOKEN_POST_URI))
return 0;
if (!pss)
pss = jsi_wsgetPss(cmdPtr, wsi, user, 1, 1);
int uplen=(cmdPtr->urlPrefix?Jsi_Strlen(cmdPtr->urlPrefix):0);
if (inPtr && cmdPtr->urlPrefix && !Jsi_Strncmp(inPtr, cmdPtr->urlPrefix, uplen))
inPtr += uplen;
if (cmdPtr->redirDisable) {// Try to defray redirect loops.
if (difftime(now, cmdPtr->stats.redirLast)>=600)
cmdPtr->redirDisable = 0;
else
cmdPtr->redirDisable--;
}
if ((cmdPtr->urlRedirect && (inPtr == 0 || *inPtr == 0 || !Jsi_Strcmp(inPtr, "/")) && !cmdPtr->redirDisable)
&& (inPtr = cmdPtr->urlRedirect) && inPtr[0]) {
cmdPtr->stats.redirCnt++;
// TODO: system time change can disrupt the following.
if (cmdPtr->redirMax>0 && !cmdPtr->redirDisable && cmdPtr->redirMax>0 && cmdPtr->stats.redirLast
&& difftime(now, cmdPtr->stats.redirLast)<600 && ++cmdPtr->redirAllCnt>cmdPtr->redirMax)
cmdPtr->redirDisable = 100;
cmdPtr->stats.redirLast = now;
rc = lws_http_redirect(wsi, 301, (uchar*)inPtr, Jsi_Strlen(inPtr), &p, end);
return (rc == 100 ? 0 : 1);
}
if (!inPtr || !*inPtr)
inPtr = "/";
if (cmdPtr->useridPass || cmdPtr->onAuth) {
int ok = 0;
int alen;
const char *auth = jsi_wsHeader(pss, "authorization", &alen);
if (auth && !Jsi_Strncasecmp(auth, "basic ", 6) && !cmdPtr->deleted) {
auth += 6;
Jsi_DString eStr = {}, bStr = {};
Jsi_DSAppendLen(&eStr, auth, alen - 6);
Jsi_Base64(Jsi_DSValue(&eStr), -1, &bStr, 1);
const char *bp = Jsi_DSValue(&bStr);
if (bp && bp[0]) {
if (!cmdPtr->onAuth)
ok = (!Jsi_Strcmp(cmdPtr->useridPass, bp));
else {
/* Pass 4 args: ws, id, url and userid:pass . */
Jsi_Obj *oarg1;
Jsi_Value *vpargs, *vargs[10];
int n = 0;
vargs[n++] = Jsi_ValueNewObj(interp, cmdPtr->fobj);
vargs[n++] = Jsi_ValueNewNumber(interp, (Jsi_Number)(pss->wid));
vargs[n++] = Jsi_ValueNewStringDup(interp, inPtr);
vargs[n++] = Jsi_ValueNewStringDup(interp, bp);
vpargs = Jsi_ValueMakeObject(interp, NULL, oarg1 = Jsi_ObjNewArray(interp, vargs, n, 0));
Jsi_IncrRefCount(interp, vpargs);
Jsi_Value *ret = Jsi_ValueNew1(interp);
bool rb = 0;
rc = Jsi_FunctionInvoke(interp, cmdPtr->onAuth, vpargs, &ret, NULL);
if (rc == JSI_OK)
rb = !Jsi_ValueIsFalse(interp, ret);
Jsi_DecrRefCount(interp, vpargs);
Jsi_DecrRefCount(interp, ret);
if (rc != JSI_OK) {
Jsi_LogError("websock bad rcv eval");
return -1;
}
ok = rb;
}
}
Jsi_DSFree(&eStr);
Jsi_DSFree(&bStr);
}
if (!ok) {
const char *realm = (cmdPtr->realm?cmdPtr->realm:"jsish");
int n = snprintf(buf, sizeof(buf), "Basic realm=\"%s\"", realm);
if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_WWW_AUTHENTICATE,
(unsigned char *)buf, n, &p, end))
return -1;
if (jsi_wsServeString(pss, wsi, "Password is required to access this page", 401, (char*)buffer, NULL)<0)
return -1;
return lws_http_transaction_completed(wsi);
}
}
if (cmdPtr->onGet || pss->onGet) {
Jsi_RC jrc;
int rrv = 1;
if (cmdPtr->getRegexp) {
rrv = 0;
jrc = Jsi_RegExpMatch(interp, cmdPtr->getRegexp, inPtr, &rrv, NULL);
if (jrc != JSI_OK)
return -1; // Error in regexp.
}
if (rrv) {
jrc = jsi_wsGetCmd(interp, cmdPtr, pss, wsi, inPtr, pss->onGet?pss->onGet:cmdPtr->onGet, tStr);
switch (jrc) {
case JSI_ERROR: return -1;
case JSI_OK: return 0;
case JSI_SIGNAL:
return jsi_ws_http_redirect(wsi, 302, tStr, &p, end);
case JSI_CONTINUE:
inPtr = Jsi_DSValue(tStr); break;
case JSI_BREAK: break;
default: break;
}
}
}
ext = Jsi_Strrchr(inPtr, '.');
Jsi_Value *rdir = (pss->rootdir?pss->rootdir:cmdPtr->rootdir);
cmdPtr->curRoot = (rdir?Jsi_ValueString(cmdPtr->interp, rdir, NULL):"./");
Jsi_DString sStr;
Jsi_DSInit(&sStr);
jsi_wsPathAlias(interp, cmdPtr, &inPtr, &sStr);
snprintf(buf, sizeof(buf), "%s/%s", cmdPtr->curRoot, inPtr);
Jsi_DSFree(&sStr);
if (cmdPtr->debug>1)
fprintf(stderr, "FILE: %s in %s | %s\n", buf, cmdPtr->curRoot, Jsi_ValueString(interp, cmdPtr->rootdir, NULL));
char extBuf[JSI_BUFSIZ], *cpde = Jsi_Strrchr(buf, '/');
isJsiWeb = (cpde && cmdPtr->jsiFnPattern && Jsi_GlobMatch(cmdPtr->jsiFnPattern, cpde+1, 0));
bool isgzip = 0;
if (!ext || !ext[1])
mime = "text/html";
else {
const char *eext = ext+1;
uint elen = Jsi_Strlen(ext);
if (elen>3 && elen<(sizeof(extBuf)-10) && !Jsi_Strcmp(ext+elen-3,".gz")) {
Jsi_Strcpy(extBuf, ext);
extBuf[elen-3] = 0;
char *ext2 = Jsi_Strrchr(extBuf, '.');
if (ext2) {
isgzip = 1;
ext = ext2;
}
}
Jsi_HashEntry *hPtr;
if (cmdPtr->mimeTypes) {
/* Lookup mime type in mimeTypes object. */
Jsi_Value *mVal = Jsi_ValueObjLookup(interp, cmdPtr->mimeTypes, ext+1, 1);
if (mVal)
mime = Jsi_ValueString(interp, mVal, NULL);
}
if (!mime) {
static const char* mtypes[] = {
"html", "text/html", "js", "application/x-javascript",
"css", "text/css", "png", "image/png", "ico", "image/icon",
"gif", "image/gif", "jpeg", "image/jpeg",
"jpg", "image/jpeg", "svg", "image/svg+xml",
"json", "application/json", "txt", "text/plain",
"jsi", "application/x-javascript", "cssi", "text/css",
"shtml", "text/html", "scss", "text/css",
"sjs", "application/x-javascript",
0, 0
};
mime = "text/html";
int i;
for (i=0; mtypes[i]; i+=2)
if (tolower(*eext) == mtypes[i][0] && !Jsi_Strncasecmp(eext, mtypes[i], -1)) {
mime = mtypes[i+1];
break;
}
}
isSSI = jsi_wsIsSSIExt(interp, cmdPtr, pss, eext);
if ((hPtr = Jsi_HashEntryFind(cmdPtr->handlers, ext)) && !cmdPtr->deleted) {
/* Use interprete html eg. using jsi_wpp preprocessor */
Jsi_DString jStr = {};
Jsi_Value *vrc = NULL;
int hrc = 0, strLen, evrc, isalloc=0;
char *vStr, *hstr = NULL;
jsi_wsHander *hdlPtr = (jsi_wsHander*)Jsi_HashValueGet(hPtr);
Jsi_Value *hv = hdlPtr->val;
if (Jsi_Strchr(buf, '\'') || Jsi_Strchr(buf, '\"')) {
jsi_wsServeString(pss, wsi, "Can not handle quotes in url", 404, NULL, NULL);
return -1;
}
cmdPtr->handlersPkg=1;
// Attempt to load package and get function.
if ((hdlPtr->flags&1) && cmdPtr->handlersPkg && Jsi_ValueIsString(interp, hv)
&& ((hstr = Jsi_ValueString(interp, hv, NULL)))) {
vrc = Jsi_NameLookup(interp, hstr);
if (!vrc) {
Jsi_Number pver = Jsi_PkgRequire(interp, hstr, 0);
if (pver >= 0)
vrc = Jsi_NameLookup(interp, hstr);
}
if (!vrc || !Jsi_ValueIsFunction(interp, vrc)) {
if (vrc)
Jsi_DecrRefCount(interp, vrc);
Jsi_LogError("Failed to autoload handle: %s", hstr);
jsi_wsServeString(pss, wsi, "Failed to autoload handler", 404, NULL, NULL);
return -1;
}
if (hdlPtr->val)
Jsi_DecrRefCount(interp, hdlPtr->val);
hdlPtr->val = vrc;
Jsi_IncrRefCount(interp, vrc);
hv = vrc;
}
if ((hdlPtr->flags&2) && !hdlPtr->triedLoad && !hdlPtr->objVar && Jsi_ValueIsFunction(interp, hv)) {
// Run command and from returned object get the parse function.
hdlPtr->triedLoad = 1;
Jsi_DSAppend(&jStr, "[null]", NULL);
Jsi_DSAppend(&jStr, "]", NULL);
vrc = Jsi_ValueNew1(interp);
evrc = Jsi_FunctionInvokeJSON(interp, hv, Jsi_DSValue(&jStr), &vrc);
if (Jsi_InterpGone(interp))
return -1;
if (evrc != JSI_OK || !vrc || !Jsi_ValueIsObjType(interp, vrc, JSI_OT_OBJECT)) {
Jsi_LogError("Failed to load obj: %s", hstr);
jsi_wsServeString(pss, wsi, "Failed to load obj", 404, NULL, NULL);
return -1;
}
Jsi_Value *fvrc = Jsi_ValueObjLookup(interp, vrc, "parse", 0);
if (!fvrc || !Jsi_ValueIsFunction(interp, fvrc)) {
Jsi_LogError("Failed to find parse: %s", hstr);
jsi_wsServeString(pss, wsi, "Failed to find parse", 404, NULL, NULL);
return -1;
}
hdlPtr->objVar = fvrc;
Jsi_IncrRefCount(interp, fvrc);
hv = vrc;
}
if (hdlPtr->objVar) { // Call the obj.parse function.
Jsi_DSAppend(&jStr, "[\"", buf, "\"]", NULL); // TODO: JSON encode.
vrc = Jsi_ValueNew1(interp);
evrc = Jsi_FunctionInvokeJSON(interp, hdlPtr->objVar, Jsi_DSValue(&jStr), &vrc);
isalloc = 1;
}
else if (Jsi_ValueIsFunction(interp, hv)) {
//printf("CNCNN: %s\n", Jsi_DSValue(&cmdPtr->cName));
Jsi_DSAppend(&jStr, "[\"", buf, "\", {wsName:\"", Jsi_DSValue(&cmdPtr->cName), "\"", "}]", NULL); // TODO: JSON encode.
vrc = Jsi_ValueNew1(interp);
evrc = Jsi_FunctionInvokeJSON(interp, hv, Jsi_DSValue(&jStr), &vrc);
isalloc = 1;
} else {
// One shot invoke of string command.
hstr = Jsi_ValueString(interp, hv, NULL);
Jsi_DSAppend(&jStr, hstr, "('", buf, "');", NULL);
evrc = Jsi_EvalString(interp, Jsi_DSValue(&jStr), JSI_EVAL_RETURN);
if (evrc == JSI_OK)
vrc = Jsi_InterpResult(interp);
}
// Take result from vrc and return it.
if (evrc != JSI_OK) {
Jsi_LogError("failure in websocket handler");
} else if ((!vrc) ||
(!(vStr = Jsi_ValueString(interp, vrc, &strLen)))) {
Jsi_LogError("failed to get result");
} else {
hrc = jsi_wsServeString(pss, wsi, vStr, 0, NULL, mime);
}
Jsi_DSFree(&jStr);
if (isalloc)
Jsi_DecrRefCount(interp, vrc);
if (hrc<=0)
return -1;
return 1;
}
}
if (!buf[0]) {
if (cmdPtr->debug)
fprintf(stderr, "empty file: %s\n", inPtr);
return -1;
}
fname = Jsi_ValueNewStringDup(interp, buf);
Jsi_IncrRefCount(interp, fname);
Jsi_DString hStr = {};
Jsi_StatBuf jsb;
bool native = Jsi_FSNative(interp, fname);
if ((native && Jsi_InterpSafe(interp) && Jsi_InterpAccess(interp, fname, JSI_INTACCESS_READ) != JSI_OK) ||
(Jsi_Stat(interp, fname, &jsb) || jsb.st_size<=0)) {
nofile:
if (cmdPtr->onUnknown || pss->onUnknown) {
Jsi_Value *uk = (pss->onUnknown?pss->onUnknown:cmdPtr->onUnknown);
Jsi_RC jrc = jsi_wsGetCmd(interp, cmdPtr, pss, wsi, inPtr, uk, NULL);
if (jrc == JSI_ERROR)
goto bail;
if (jrc == JSI_OK)
goto done;
}
if (0 && Jsi_Strstr(buf, "favicon.ico"))
rc = jsi_wsServeString(pss, wsi, "data:;base64,iVBORw0KGgo=", 200, NULL, "image/icon");
else {
const char *cp = Jsi_Strrchr(buf,'/');
if (cp && cp[1]) {
char statPath[PATH_MAX];
snprintf(statPath, sizeof(statPath), "/zvfs/lib/web%s", cp);
Jsi_DecrRefCount(interp, fname);
fname = Jsi_ValueNewStringDup(interp, statPath);
Jsi_IncrRefCount(interp, fname);
if (!Jsi_Stat(interp, fname, &jsb) && jsb.st_size>0) {
native = 0;
goto serve;
}
}
if (cmdPtr->noWarn==0 && !Jsi_Strstr(buf, "favicon.ico"))
fprintf(stderr, "failed open file for read: %s\n", buf);
rc = jsi_wsServeString(pss, wsi, "<b style='color:red'>ERROR: can not serve file!</b>", 404, NULL, NULL);
}
Jsi_DecrRefCount(interp, fname);
goto done;
}
if (!ext || isSSI)
goto serve;
if (S_ISDIR(jsb.st_mode)) {
if (cmdPtr->noWarn==0)
fprintf(stderr, "can not serve directory: %s\n", buf);
rc = jsi_wsServeString(pss, wsi, "<b style='color:red'>ERROR: can not serve directory!</b>", 404, NULL, NULL);
Jsi_DecrRefCount(interp, fname);
goto done;
}
serve:
n = 0;
// TODO: add automatic cookie mgmt?
/*
if (!strcmp((const char *)in, "/") &&
!lws_hdr_total_length(wsi, WSI_TOKEN_HTTP_COOKIE)) {
gettimeofday(&tv, NULL);
n = sprintf(b64, "test=LWS_%u_%u_COOKIE;Max-Age=360000",
(unsigned int)tv.tv_sec,
(unsigned int)tv.tv_usec);
if (lws_add_http_header_by_name(wsi,
(unsigned char *)"set-cookie:",
(unsigned char *)b64, n, &p,
(unsigned char *)buffer + sizeof(buffer)))
return 1;
}*/
static const char stsStr[] = "max-age=15768000 ; includeSubDomains";
if (lws_is_ssl(wsi) && lws_add_http_header_by_name(wsi,
(uchar *) "Strict-Transport-Security:",
(uchar *) stsStr,
sizeof(stsStr)-1, &p, (uchar *)buffer + sizeof(buffer)))
goto bail;
n = p - buffer;
if (n>0)
Jsi_DSAppendLen(&hStr, (char*)buffer, n);
p = buffer;
if (isgzip) {
if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_CONTENT_ENCODING,
(unsigned char *)"gzip", n, &p, end))
goto bail;
}
if (cmdPtr->headers && !jsi_wsAddHeader(interp, cmdPtr, wsi, cmdPtr->headers, &hStr))
goto bail;
if (pss->headers && !jsi_wsAddHeader(interp, cmdPtr, wsi, pss->headers, &hStr))
goto bail;
n = Jsi_DSLength(&hStr);
if (native && !isSSI && !isJsiWeb) {
if (!jsi_wsAddStdHeader(interp, cmdPtr, wsi, &hStr)) {
Jsi_DecrRefCount(interp, fname);
goto bail;
}
int hrc = lws_serve_http_file(wsi, buf, mime, Jsi_DSValue(&hStr), Jsi_DSLength(&hStr));
if (hrc >= 0 && cmdPtr->onModify)
jsi_wsFileAdd(interp, cmdPtr, fname);
Jsi_DecrRefCount(interp, fname);
if (hrc<0) {
if (cmdPtr->noWarn==0)
fprintf(stderr, "can not serve file (%d): %s\n", hrc, buf);
goto bail;
} else if (hrc > 0 && lws_http_transaction_completed(wsi))
goto bail;
} else {
// Need to read data for non-native files.
Jsi_DString dStr = {}, fStr = {};
if (isSSI)
rc = jsi_wsEvalSSI(interp, cmdPtr, fname, &fStr, 1, pss);
else {
rc = jsi_wsFileRead(interp, fname, &fStr, cmdPtr, pss);
if (isJsiWeb)
Jsi_DSAppend(&fStr, "\nwindow.jsiWebSocket=true;", NULL);
}
if (rc != JSI_OK) {
Jsi_DSFree(&fStr);
goto nofile;
}
int hrc = jsi_wsServeHeader(pss, wsi, (int)Jsi_DSLength(&fStr), 200, Jsi_DSValue(&hStr), mime, &dStr);
if (hrc>=0) {
Jsi_DSAppendLen(&dStr, Jsi_DSValue(&fStr), Jsi_DSLength(&fStr));
char *strVal = Jsi_DSValue(&dStr);
int strLen = Jsi_DSLength(&dStr);
hrc = jsi_wswrite(pss, wsi, (unsigned char*)strVal, strLen, LWS_WRITE_HTTP);
}
Jsi_DecrRefCount(interp, fname);
Jsi_DSFree(&dStr);
Jsi_DSFree(&fStr);
if (hrc<0) {
if (cmdPtr->noWarn==0)
fprintf(stderr, "can not serve data (%d): %s\n", hrc, buf);
goto bail;
} else if (hrc > 0 && lws_http_transaction_completed(wsi))
goto bail;
}
done:
Jsi_DSFree(&hStr);
return rc;
bail:
rc = 1;
goto done;
} | 91,632,879,591,078,570,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,367 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void jsi_ToHexStr(const uchar *indata, int dlen, char *out) {
static char hex[] = "0123456789abcdef";
int i, n=0;
for (i=0; i<dlen; i++) {
int c = indata[i];
out[n++] = hex[(c>>4)&0xf];
out[n++] = hex[c&0xf];
}
out[n] = 0;
} | 76,784,881,525,113,660,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,368 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC mdbEvalStep(MyDbEvalContext *p) {
Jsi_RC rc = JSI_OK;
if( p->prep==0)
rc = mdbEvalPrep(p);
if (rc == JSI_BREAK)
return JSI_BREAK;
if (rc == JSI_OK)
rc = mdbEvalStepSub(p, 1, NULL);
return rc;
} | 76,204,573,240,217,040,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,369 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_OpCodes *code_push_vstring(jsi_Pstate *p, jsi_Pline *line, Jsi_String *s) {
JSI_NEW_CODESLN(0,OP_PUSHVSTR, s);
} | 180,479,410,588,906,400,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,370 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_Value* Jsi_ValueNewString(Jsi_Interp *interp, const char *s, int len) {
assert(s);
Jsi_Value *v = Jsi_ValueNew(interp);
Jsi_Obj *obj = Jsi_ObjNewType(interp, JSI_OT_STRING);
Jsi_ValueMakeObject(interp, &v, obj);
obj->d.s.str = (char*)s;
obj->d.s.len = (len<0?Jsi_Strlen(s):(uint)len);
return v;
} | 308,936,009,204,177,730,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,371 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC NumberIsFiniteCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr) {
return jsi_NumberIsFiniteCmd(interp, args, _this, ret, funcPtr, 1);
} | 53,845,278,685,492,210,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,372 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC JSONStringifyCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
bool strict = 1;
Jsi_Value *jsv = Jsi_ValueArrayIndex(interp, args, 1);
if (jsv && Jsi_ValueGetBoolean(interp, jsv, &strict) != JSI_OK)
return Jsi_LogError("Expected boolean");
int quote = JSI_OUTPUT_JSON;
if (strict) quote|=JSI_JSON_STRICT;
Jsi_DString dStr = {};
Jsi_Value *arg = Jsi_ValueArrayIndex(interp, args, 0);
Jsi_ValueGetDString(interp, arg, &dStr, quote);
Jsi_ValueFromDS(interp, &dStr, ret);
return JSI_OK;
} | 238,882,468,374,615,500,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,373 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void dbEvalSetColumnJSON(DbEvalContext *p, int iCol, Jsi_DString *dStr) {
Jsi_Interp *interp = p->jdb->interp;
char nbuf[JSI_MAX_NUMBER_STRING];
sqlite3_stmt *pStmt = p->pPreStmt->pStmt;
switch( sqlite3_column_type(pStmt, iCol) ) {
case SQLITE_BLOB: {
int bytes = sqlite3_column_bytes(pStmt, iCol);
const char *zBlob = (char*)sqlite3_column_blob(pStmt, iCol);
if( !zBlob ) {
Jsi_DSAppend(dStr, "null", NULL);
return;
}
Jsi_JSONQuote(interp, zBlob, bytes, dStr);
return;
}
case SQLITE_INTEGER: {
sqlite_int64 v = sqlite3_column_int64(pStmt, iCol);
if (v==0 || v==1) {
const char *dectyp = sqlite3_column_decltype(pStmt, iCol);
if (dectyp && !Jsi_Strncasecmp(dectyp,"bool", 4)) {
Jsi_DSAppend(dStr, (v?"true":"false"), NULL);
return;
}
}
#ifdef __WIN32
snprintf(nbuf, sizeof(nbuf), "%" PRId64, (Jsi_Wide)v);
#else
snprintf(nbuf, sizeof(nbuf), "%lld", v);
#endif
Jsi_DSAppend(dStr, nbuf, NULL);
return;
}
case SQLITE_FLOAT: {
Jsi_NumberToString(interp, sqlite3_column_double(pStmt, iCol), nbuf, sizeof(nbuf));
Jsi_DSAppend(dStr, nbuf, NULL);
return;
}
case SQLITE_NULL: {
Jsi_DSAppend(dStr, "null", NULL);
return;
}
}
const char *str = (char*)sqlite3_column_text(pStmt, iCol );
if (!str)
str = p->jdb->optPtr->nullvalue;
Jsi_JSONQuote(interp, str?str:"", -1, dStr);
} | 120,034,018,456,237,180,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,374 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void Jsi_MutexDelete(Jsi_Interp *interp, Jsi_Mutex *mtx) { } | 252,580,468,451,023,100,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,375 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_OptionsConf(Jsi_Interp *interp, Jsi_OptionSpec *specs, void *rec, Jsi_Value *val, Jsi_Value **ret, Jsi_Wide flags)
{
flags |= JSI_OPTS_IS_UPDATE;
if (!Jsi_OptionsValid(interp, specs))
return Jsi_LogError("invalid options");
if (!val)
return Jsi_OptionsDump(interp, specs, rec, ret, flags);
if (val->vt == JSI_VT_NULL)
return Jsi_OptionsDump(interp, specs, rec, ret, flags|JSI_OPTS_VERBOSE);
if (Jsi_ValueIsString(interp, val)) {
const char *cp = Jsi_ValueString(interp, val, NULL);
if (cp && *cp)
return Jsi_OptionsGet(interp, specs, rec, cp, ret, flags);
Jsi_Obj *sobj = Jsi_ObjNewType(interp, JSI_OT_ARRAY);
Jsi_Value *svalue = Jsi_ValueMakeObject(interp, NULL, sobj);
jsi_DumpOptionSpecs(interp, sobj, specs);
Jsi_ValueReplace(interp, ret, svalue);
return JSI_OK;
}
if (val->vt != JSI_VT_OBJECT)
return Jsi_LogError("expected string, object, or null");
if (Jsi_OptionsProcess(interp, specs, rec, val, JSI_OPTS_IS_UPDATE|flags) < 0)
return JSI_ERROR;
return JSI_OK;
} | 43,449,474,382,879,430,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,376 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void *Jsi_TreeKeyGet(Jsi_TreeEntry *hPtr)
{
Jsi_Tree *t = hPtr->treePtr;
return (t->keyType == JSI_KEYS_ONEWORD || t->keyType == JSI_KEYS_STRINGKEY ? hPtr->key.oneWordValue : hPtr->key.string);
} | 320,469,846,392,857,200,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,377 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | bool Jsi_MapUnset(Jsi_Map *mapPtr, const void *key){
SIGASSERT(mapPtr, MAP);
switch (mapPtr->typ) {
case JSI_MAP_HASH: return Jsi_HashUnset(mapPtr->v.hash, (void*)key);
case JSI_MAP_TREE: return Jsi_TreeUnset(mapPtr->v.tree, (void*)key);
case JSI_MAP_LIST: {
/*Jsi_ListEntry* lptr = (key == NULL? Jsi_ListGetFront(mapPtr->v.list) : Jsi_ListGetBack(mapPtr->v.list));
if (lptr)
return Jsi_ListUnset(lptr);*/
break;
}
case JSI_MAP_NONE: break;
}
return false;
} | 134,250,172,034,829,330,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,378 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | jsi_wsGetHeaders(jsi_wsPss *pss, struct lws *wsi, Jsi_DString* dStr, int lens[], int hmax)
{
int n = 0, i = 0, nlen;
char buf[JSI_BUFSIZ];
const char *cp;
while ((cp = (char*)lws_token_to_string((enum lws_token_indexes)n))) {
int len = lws_hdr_copy(wsi, buf, sizeof(buf), ( enum lws_token_indexes)n);
n++;
if (i>=(n*2+2)) break;
if (len<=0) continue;
buf[sizeof(buf)-1] = 0;
if (!buf[0]) continue;
nlen = Jsi_Strlen(cp);
if (nlen>0 && cp[nlen-1]==' ') nlen--;
if (nlen>0 && cp[nlen-1]==':') nlen--;
Jsi_DSAppendLen(dStr, cp, nlen);
Jsi_DSAppend(dStr, "=", buf, "\n", NULL);
if (lens) {
lens[i++] = nlen;
lens[i++] = Jsi_Strlen(buf);
}
}
//printf("HEE: %d = %s\n", pss->wid, Jsi_DSValue(dStr) );
return i;
} | 16,316,178,880,789,056,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,379 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC StringReplaceCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
/* Now handles perl regex flag extensions.*/
const char *source_str;
int source_len, bLen;
const char *replace_str = NULL;
int replace_len;
int regexec_flags = 0;
Jsi_Value *seq, *strVal;
Jsi_DString dStr = {};
regex_t *regex;
Jsi_Regex *re;
const char *p;
int maxArgs = 1;
int offset = 0, n, j, isglob = 0, num_matches = 0;
/* Is a generic String.replace if _this->d.obj is a function */
ChkString(_this, funcPtr, source_str, &source_len, &bLen);
source_len = bLen;
if (!skip)
strVal = _this;
else
strVal = Jsi_ValueArrayIndex(interp, args, 0);
seq = Jsi_ValueArrayIndex(interp, args, skip);
Jsi_Value *repVal = Jsi_ValueArrayIndex(interp, args, 1+skip);
if (!Jsi_ValueIsFunction(interp, repVal))
replace_str = Jsi_ValueToString(interp, repVal, &replace_len);
else
maxArgs = repVal->d.obj->d.fobj->func->argnames->argCnt;
Jsi_DSInit(&dStr);
if (Jsi_ValueIsString(interp, seq)) {
const char *ce, *cp = Jsi_ValueString(interp, seq, NULL);
if (!(ce = Jsi_Strstr(source_str, cp)))
Jsi_ValueMakeStringDup(interp, ret, source_str);
else {
int slen;
slen = (ce-source_str);
if (slen)
Jsi_DSAppendLen(&dStr, source_str, slen);
if (replace_str)
Jsi_DSAppendLen(&dStr, replace_str, replace_len);
else {
Jsi_Value *inStr = Jsi_ValueNewStringDup(interp, source_str);
Jsi_IncrRefCount(interp, inStr);
Jsi_RC rc = Jsi_FunctionInvokeString(interp, repVal, inStr, &dStr);
if (Jsi_InterpGone(interp))
return JSI_ERROR;
if (rc != JSI_OK) {
Jsi_DSFree(&dStr);
Jsi_DecrRefCount(interp, inStr);
return JSI_ERROR;
}
Jsi_DecrRefCount(interp, inStr);
}
Jsi_DSAppend(&dStr, ce+Jsi_Strlen(cp), NULL);
Jsi_ValueFromDS(interp, &dStr, ret);
}
return JSI_OK;
}
if (seq == NULL || seq->vt != JSI_VT_OBJECT || seq->d.obj->ot != JSI_OT_REGEXP) {
Jsi_ValueMakeNull(interp, ret);
return JSI_OK;
}
re = seq->d.obj->d.robj;
regex = &re->reg;
isglob = (re->eflags & JSI_REG_GLOB);
regmatch_t pmatch[MAX_SUBREGEX] = {};
/* If an offset has been specified, adjust for that now.
* If it points past the end of the string, point to the terminating null
*/
int eoffset=0;
if (offset) {
if (offset < 0) {
offset += source_len + 1;
}
if (offset > source_len) {
offset = source_len;
}
else if (offset < 0) {
offset = 0;
}
}
Jsi_DSAppendLen(&dStr, source_str, offset);
n = source_len - offset;
p = source_str + offset;
Jsi_RC rc = JSI_OK;
do {
if (num_matches > 10000000) {
Jsi_LogBug("regexp infinite loop");
rc = JSI_ERROR;
break;
}
int match = regexec(regex, p, MAX_SUBREGEX, pmatch, regexec_flags);
if (match >= REG_BADPAT) {
char buf[JSI_MAX_NUMBER_STRING];
regerror(match, regex, buf, sizeof(buf));
Jsi_LogError("error while matching pattern: %s", buf);
Jsi_DSFree(&dStr);
return JSI_ERROR;
}
if (match == REG_NOMATCH) {
break;
}
num_matches++;
Jsi_DSAppendLen(&dStr, p, pmatch[0].rm_so);
if (replace_str && !Jsi_Strchr(replace_str, '$'))
Jsi_DSAppend(&dStr, replace_str, NULL);
else if (replace_str) {
for (j = 0; j < replace_len; j++) {
int idx;
int c = replace_str[j];
if (c == '$' && j < replace_len) {
c = replace_str[++j];
if ((c >= '0') && (c <= '9')) {
idx = c - '0';
} else if (c == '&') {
idx = 0;
} else if (c == '$') {
Jsi_DSAppendLen(&dStr, replace_str + j, 1);
continue;
}
else if (c == '\'') {
Jsi_DSAppendLen(&dStr, p + pmatch[0].rm_eo, pmatch[0].rm_eo-Jsi_Strlen(p));
continue;
}
else if (c == '`') {
Jsi_DSAppendLen(&dStr, p, pmatch[0].rm_so);
continue;
}
else {
Jsi_DSAppendLen(&dStr, replace_str + j - 1, 2);
continue;
}
} else {
Jsi_DSAppendLen(&dStr, replace_str + j, 1);
continue;
}
if ((idx < MAX_SUBREGEX) && pmatch[idx].rm_so != -1 && pmatch[idx].rm_eo != -1) {
Jsi_DSAppendLen(&dStr, p + pmatch[idx].rm_so,
pmatch[idx].rm_eo - pmatch[idx].rm_so);
}
}
} else {
Jsi_DString sStr;
Jsi_DSInit(&sStr);
if (pmatch[0].rm_so <= 0 && pmatch[0].rm_eo <= 0)
break;
int olen = -1;
char *ostr = jsi_SubstrDup(p, -1, pmatch[0].rm_so, pmatch[0].rm_eo - pmatch[0].rm_so, &olen);
Jsi_Value *inStr = Jsi_ValueMakeBlob(interp, NULL, (uchar*)ostr, olen);
Jsi_DSFree(&sStr);
Jsi_IncrRefCount(interp, inStr);
if (maxArgs==1) {
Jsi_RC rc = Jsi_FunctionInvokeString(interp, repVal, inStr, &dStr);
if (Jsi_InterpGone(interp))
return JSI_ERROR;
if (rc != JSI_OK) {
Jsi_DSFree(&dStr);
Jsi_DecrRefCount(interp, inStr);
return JSI_ERROR;
}
} else {
Jsi_Value *vpargs, *items[MAX_SUBREGEX] = {}, *ret;
int i;
items[0] = inStr;
for (i=1; i<=(int)re->reg.re_nsub && i<(MAX_SUBREGEX-3); i++) {
if (pmatch[i].rm_so<0)
items[i] = interp->NullValue;
else {
ostr = jsi_SubstrDup(p, -1, pmatch[i].rm_so, pmatch[i].rm_eo - pmatch[i].rm_so, &olen);
items[i] = Jsi_ValueMakeBlob(interp, NULL, (uchar*)ostr, olen);
}
}
items[i++] = Jsi_ValueMakeNumber(interp, NULL, eoffset+pmatch[0].rm_so);
items[i++] = strVal;
vpargs = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, items, i, 0));
Jsi_IncrRefCount(interp, vpargs);
ret = Jsi_ValueNew1(interp);
rc = Jsi_FunctionInvoke(interp, repVal, vpargs, &ret, NULL);
if (Jsi_InterpGone(interp))
return JSI_ERROR;
Jsi_DecrRefCount(interp, vpargs);
if (rc == JSI_OK)
Jsi_DSAppend(&dStr, Jsi_ValueToString(interp, ret, NULL), NULL);
Jsi_DecrRefCount(interp, ret);
if (rc != JSI_OK) {
Jsi_DSFree(&dStr);
Jsi_DecrRefCount(interp, inStr);
return JSI_ERROR;
}
}
Jsi_DecrRefCount(interp, inStr);
}
eoffset += pmatch[0].rm_eo;
p += pmatch[0].rm_eo;
n -= pmatch[0].rm_eo;
/* If -all is not specified, or there is no source left, we are done */
if (!isglob || n == 0 || pmatch[0].rm_eo == 0) {
break;
}
/* An anchored pattern without -line must be done */
if ((re->eflags & JSI_REG_NEWLINE) == 0 && re->pattern[0] == '^') {
break;
}
/* If the pattern is empty, need to step forwards */
if (re->pattern[0] == '\0' && n) {
/* Need to copy the char we are moving over */
Jsi_DSAppendLen(&dStr, p, 1);
p++;
n--;
}
regexec_flags |= REG_NOTBOL;
} while (n);
/*
* Copy the portion of the string after the last match to the
* result variable.
*/
Jsi_DSAppend(&dStr, p, NULL);
Jsi_ValueFromDS(interp, &dStr, ret);
return rc;
} | 51,053,313,361,716,630,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,380 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC jsi_PushVar(jsi_Pstate *ps, jsi_OpCode *ip, jsi_ScopeChain *scope, Jsi_Value *currentScope, int context_id) {
Jsi_Interp *interp = ps->interp;
jsi_FastVar *fvar = (typeof(fvar))ip->data;
SIGASSERT(fvar,FASTVAR);
Jsi_Value **dvPtr = &_jsi_STACKIDX(interp->framePtr->Sp), *dv = *dvPtr, *v = NULL;
if (fvar->context_id == context_id && fvar->ps == ps) {
v = fvar->lval;
} else {
char *varname = fvar->varname;
v = Jsi_ValueObjLookup(interp, currentScope, varname, 1);
if (v) {
fvar->local = 1;
if (v->vt == JSI_VT_UNDEF) {
v->d.lookupFail = varname;
v->f.bits.lookupfailed = 1;
}
} else {
v = jsi_ScopeChainObjLookupUni(scope, varname);
if (v)
fvar->local = 1;
else {
/* add to global scope. TODO: do not define if a right_val??? */
Jsi_Value *global_scope = scope->chains_cnt > 0 ? scope->chains[0]:currentScope;
Jsi_Value key = VALINIT, *kPtr = &key; // Note: a string key so no reset needed.
Jsi_ValueMakeStringKey(interp, &kPtr, varname);
v = jsi_ValueObjKeyAssign(interp, global_scope, &key, NULL, JSI_OM_DONTENUM);
if (v->vt == JSI_VT_UNDEF) {
v->d.lookupFail = varname;
v->f.bits.lookupfailed = 1;
}
jsi_ValueDebugLabel(v, "var", varname);
bool isNew;
Jsi_HashEntry *hPtr = Jsi_HashEntryNew(interp->varTbl, varname, &isNew);
if (hPtr && isNew)
Jsi_HashValueSet(hPtr, 0);
}
}
Jsi_IncrRefCount(interp, v);
}
if (dv != v && (dv->vt != JSI_VT_VARIABLE || dv->d.lval != v)) {
Jsi_ValueReset(interp, dvPtr);
dv->vt = JSI_VT_VARIABLE;
SIGASSERT(v, VALUE);
dv->d.lval = v;
dv->f.bits.local = (fvar->local);
}
SIGASSERT(v, VALUE);
jsiPush(interp,1);
return JSI_OK;
} | 293,061,112,697,041,450,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,381 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_Value *Jsi_ValueArrayIndex(Jsi_Interp *interp, Jsi_Value *args, int index)
{
Jsi_Obj *obj = args->d.obj;
Jsi_Value *v;
assert(args->vt == JSI_VT_OBJECT);
if (obj->isarrlist && obj->arr)
return ((index < 0 || (uint)index >= obj->arrCnt) ? NULL : obj->arr[index]);
char unibuf[JSI_MAX_NUMBER_STRING];
Jsi_NumberItoA10(index, unibuf, sizeof(unibuf));
v = Jsi_TreeObjGetValue(args->d.obj, unibuf, 0);
return v;
} | 173,645,783,065,360,730,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,382 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int tree_levelorder(Jsi_Tree *treePtr, Jsi_TreeEntry *hPtr, Jsi_TreeWalkProc *callback,
void *data, int curlev, int level, int *cnt) {
uint epoch = treePtr->epoch;
if (hPtr == NULL) return JSI_OK;
if (curlev > level) return JSI_OK;
if (curlev == level) {
if (callback(treePtr, hPtr, data) != JSI_OK || epoch != treePtr->epoch)
return JSI_ERROR;
(*cnt)++;
}
if (hPtr->right != NULL) {
if (tree_levelorder(treePtr, hPtr->right, callback, data, curlev+1, level, cnt) != JSI_OK || epoch != treePtr->epoch)
return JSI_ERROR;
}
if (hPtr->left != NULL) {
if (tree_levelorder(treePtr, hPtr->left, callback, data, curlev+1, level, cnt) != JSI_OK || epoch != treePtr->epoch)
return JSI_ERROR;
}
return JSI_OK;
} | 218,612,613,523,921,500,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,383 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_OpCodes *code_typeof(jsi_Pstate *p, jsi_Pline *line, int e) { JSI_NEW_CODESLN(0,OP_TYPEOF, e); } | 48,794,911,134,204,670,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,384 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | uint Jsi_HashSize(Jsi_Hash *hashPtr) { return hashPtr->numEntries; } | 88,078,677,626,735,380,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,385 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC dbBindOptionStmt(Jsi_Db *jdb, sqlite3_stmt *pStmt, OptionBind *obPtr,
int dataIdx, int bindMax, Jsi_CDataDb *dbopts)
{
Jsi_Interp *interp = jdb->interp;
int j, k, cnt = 0, idx, sidx = -1, rc = 0;
Jsi_StructSpec *specPtr, *specs;
void *rec;
Jsi_DString *eStr;
const char *bName;
int lastBind = sqlite3_bind_parameter_count(pStmt);
if (lastBind<=0)
return JSI_OK;
int structSize = 0;
Jsi_Wide flags = 0;
sqlite3_destructor_type statFlags = ((dbopts->noStatic)?SQLITE_TRANSIENT:SQLITE_STATIC);
specPtr = dbopts[0].sf;
structSize = specPtr[obPtr->optLen].size;
for (j=1; j<=lastBind; j++) {
bName = sqlite3_bind_parameter_name(pStmt, j);
if (bName==NULL || bName[0]==0 || bName[1]==0)
continue;
idx = j;
if (dbopts[0].prefix==0)
k = 0;
else {
for (k=0; dbopts[k].sf; k++) {
if (bName[0] == dbopts[k].prefix)
break;
}
if (bindMax>0 && k>=bindMax)
continue;
if (!dbopts[k].sf) {
Jsi_LogError("bad bind: %s", bName);
continue;
}
}
specs = dbopts[k].sf;
rec = dbopts[k].data;
if (k==0) {
if (dbopts->isMap) {
Jsi_Map *map = *(typeof(map)*)rec;
rec = Jsi_MapEntryFind(map, (void*)(intptr_t)dataIdx);
if (!rec) return JSI_ERROR;
} else if (dbopts->isPtrs)
rec = ((void**)rec)[dataIdx];
else
rec = ((uchar*)rec)+ (dataIdx * structSize);
}
if (bName[0] == '?')
sidx = atoi(bName+1);
for (specPtr = specs, cnt=1; specPtr->id>=JSI_OPTION_BOOL && specPtr->id < JSI_OPTION_END; specPtr++, cnt++) {
if (specPtr->flags&JSI_OPT_DB_IGNORE)
continue;
if (bName[0] == '?') {
if (cnt == sidx)
break;
} else {
const char *sName = specPtr->name;
if (bName[1] == sName[0] && !Jsi_Strcmp(bName+1, sName))
break;
}
}
if (specPtr->id<JSI_OPTION_BOOL || specPtr->id>=JSI_OPTION_END)
return Jsi_LogError("unknown bind: %s", bName);
char *ptr = (char *)rec + specPtr->offset;
switch (specPtr->id) {
case JSI_OPTION_BOOL:
rc = sqlite3_bind_int(pStmt, idx, *(int*)ptr);
break;
case JSI_OPTION_INT: rc = sqlite3_bind_int64(pStmt, idx, *(int*)ptr); break;
case JSI_OPTION_UINT:rc = sqlite3_bind_int64(pStmt, idx, *(uint*)ptr); break;
case JSI_OPTION_INT8: rc = sqlite3_bind_int64(pStmt, idx, *(int8_t*)ptr); break;
case JSI_OPTION_UINT8:rc = sqlite3_bind_int64(pStmt, idx, *(uint8_t*)ptr); break;
case JSI_OPTION_INT16: rc = sqlite3_bind_int64(pStmt, idx, *(int16_t*)ptr); break;
case JSI_OPTION_UINT16:rc = sqlite3_bind_int64(pStmt, idx, *(uint16_t*)ptr); break;
case JSI_OPTION_INT32: rc = sqlite3_bind_int64(pStmt, idx, *(int32_t*)ptr); break;
case JSI_OPTION_UINT32:rc = sqlite3_bind_int64(pStmt, idx, *(uint32_t*)ptr); break;
case JSI_OPTION_TIME_W:
case JSI_OPTION_INT64: rc = sqlite3_bind_int64(pStmt, idx, *(int64_t*)ptr); break;
case JSI_OPTION_UINT64:rc = sqlite3_bind_int64(pStmt, idx, *(uint64_t*)ptr); break;
case JSI_OPTION_USHORT:rc = sqlite3_bind_int64(pStmt, idx, *(ushort*)ptr); break;
case JSI_OPTION_SHORT:rc = sqlite3_bind_int64(pStmt, idx, *(short*)ptr); break;
case JSI_OPTION_LONG:rc = sqlite3_bind_int64(pStmt, idx, *(long*)ptr); break;
case JSI_OPTION_ULONG:rc = sqlite3_bind_int64(pStmt, idx, *(ulong*)ptr); break;
case JSI_OPTION_INTPTR_T:rc = sqlite3_bind_int64(pStmt, idx, *(intptr_t*)ptr); break;
case JSI_OPTION_UINTPTR_T:rc = sqlite3_bind_int64(pStmt, idx, *(uintptr_t*)ptr); break;
case JSI_OPTION_SIZE_T:rc = sqlite3_bind_int64(pStmt, idx, *(size_t*)ptr); break;
case JSI_OPTION_SSIZE_T:rc = sqlite3_bind_int64(pStmt, idx, *(ssize_t*)ptr); break;
case JSI_OPTION_LDOUBLE:rc = sqlite3_bind_int64(pStmt, idx, *(ldouble*)ptr); break;
case JSI_OPTION_FLOAT:rc = sqlite3_bind_int64(pStmt, idx, *(float*)ptr); break;
case JSI_OPTION_TIME_T:
rc = sqlite3_bind_int64(pStmt, idx, (Jsi_Wide)*(time_t*)ptr);
break;
case JSI_OPTION_NUMBER:
rc = sqlite3_bind_double(pStmt, idx, (double)*(Jsi_Number*)ptr);
break;
case JSI_OPTION_TIME_D:
case JSI_OPTION_DOUBLE:
rc = sqlite3_bind_double(pStmt, idx, (double)*(Jsi_Number*)ptr);
break;
case JSI_OPTION_CUSTOM: {
Jsi_OptionCustom* cust = Jsi_OptionCustomBuiltin(specPtr->custom);
if (cust && cust->formatProc) {
Jsi_DString dStr;
Jsi_DSInit(&dStr);
if ((*cust->formatProc)(interp, (Jsi_OptionSpec*)specPtr, NULL, &dStr, rec, flags) != JSI_OK) {
Jsi_DSFree(&dStr);
return JSI_ERROR;
}
rc = sqlite3_bind_text(pStmt, idx, Jsi_DSValue(&dStr), -1, SQLITE_TRANSIENT );
Jsi_DSFree(&dStr);
} else
return Jsi_LogError("missing or invalid custom for \"%s\"", specPtr->name);
break;
}
case JSI_OPTION_DSTRING:
eStr = (Jsi_DString*)ptr;
if (jdb->optPtr->nullvalue && !Jsi_Strcmp(jdb->optPtr->nullvalue, Jsi_DSValue(eStr)))
rc = sqlite3_bind_text(pStmt, idx, NULL, -1, statFlags );
else
rc = sqlite3_bind_text(pStmt, idx, Jsi_DSValue(eStr), -1, statFlags );
break;
case JSI_OPTION_STRBUF:
if (jdb->optPtr->nullvalue && ptr && !Jsi_Strcmp(jdb->optPtr->nullvalue, (char*)ptr))
rc = sqlite3_bind_text(pStmt, idx, NULL, -1, statFlags );
else
rc = sqlite3_bind_text(pStmt, idx, (char*)ptr, -1, statFlags );
break;
case JSI_OPTION_STRKEY:
rc = sqlite3_bind_text(pStmt, idx, *(char**)ptr, -1, SQLITE_STATIC );
break;
#ifndef JSI_LITE_ONLY
case JSI_OPTION_STRING:
rc = sqlite3_bind_text(pStmt, idx, Jsi_ValueString(interp, *((Jsi_Value **)ptr), NULL), -1, statFlags );
break;
#else
case JSI_OPTION_STRING:
#endif
case JSI_OPTION_VALUE: /* Unsupported. */
case JSI_OPTION_VAR:
case JSI_OPTION_OBJ:
case JSI_OPTION_ARRAY:
case JSI_OPTION_REGEXP:
case JSI_OPTION_FUNC:
#ifdef __cplusplus
case JSI_OPTION_END:
case JSI_OPTION_USEROBJ:
#else
default:
#endif
Jsi_LogError("unsupported jdb option type \"%s\" for \"%s\"", jsi_DbOptionTypeStr(specPtr->id, 0), specPtr->name);
return JSI_ERROR;
}
if (rc != SQLITE_OK)
Jsi_LogError("bind failure: %s", sqlite3_errmsg(jdb->db));
}
cnt++;
return JSI_OK;
} | 249,082,123,480,156,150,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,386 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | bool Jsi_ValueIsStringKey(Jsi_Interp* interp, Jsi_Value *key)
{
if (key->vt == JSI_VT_STRING && key->f.bits.isstrkey)
return 1;
if (key->vt == JSI_VT_OBJECT && key->d.obj->ot == JSI_OT_STRING && key->d.obj->isstrkey)
return 1;
return 0;
} | 121,212,128,017,170,200,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,387 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int jsi_FSAccessProc(Jsi_Interp *interp, Jsi_Value* path, int mode) {
const char *pathPtr = Jsi_ValueToString(interp, path, NULL);
Jsi_DString dStr = {};
if (*pathPtr == '~')
pathPtr = jsi_TildePath(interp, pathPtr, &dStr);
int rc = access(pathPtr, mode);
Jsi_DSFree(&dStr);
return rc;
} | 48,229,436,931,935,820,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,388 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_OpCodes *code_div() { JSI_NEW_CODES(0,OP_DIV, 0); } | 278,152,826,743,310,200,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,389 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_RC jsi_FunctionSubCall(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Value *tocall, int discard)
{
Jsi_RC rc = JSI_OK;
const char *oldCurFunc = interp->curFunction, *spnam = "";
jsi_OpCode *ip = interp->curIp;
int adds, as_constructor = (ip->op == OP_NEWFCALL);
double timStart = 0;
int docall;
int calltrc = 0, profile = interp->profile, coverage = interp->coverage;
jsi_PkgInfo *pkg;
int tc;
//char *lpv = interp->lastPushStr;
if (tocall->vt == JSI_VT_UNDEF && tocall->f.bits.lookupfailed && tocall->d.lookupFail && !interp->noAutoLoad) {
spnam = tocall->d.lookupFail;
tocall->f.bits.lookupfailed = 0;
tocall = jsi_LoadFunction(interp, spnam, tocall);
interp->lastPushStr = (char*)spnam;
interp->curIp = ip;
}
if (!Jsi_ValueIsFunction(interp, tocall)) {
// if (tocall->f.bits.subscriptfailed && tocall->d.lookupFail)
// spnam = tocall->d.lookupFail;
jsi_DumpFunctions(interp, spnam);
rc = JSI_ERROR;
goto empty_func;
}
if (tocall->d.obj->d.fobj==NULL || tocall->d.obj->d.fobj->func==NULL) { /* empty function */
empty_func:
//jsiPop(interp, stackargc);
//jsiClearStack(interp,1);
//Jsi_ValueMakeUndef(interp, &_jsi_TOP);
interp->curFunction = oldCurFunc;
Jsi_DecrRefCount(interp, _this);
if (rc==JSI_OK)
rc = JSI_CONTINUE;
return rc;
//goto done;
}
Jsi_FuncObj *fobj = tocall->d.obj->d.fobj;
Jsi_Func *funcPtr = fobj->func;
if (funcPtr->callback == jsi_NoOpCmd || tocall->d.obj->isNoOp) {
jsi_NoOpCmd(interp, NULL, NULL, NULL, NULL);
goto empty_func;
}
if (!interp->asserts && funcPtr->callback == jsi_AssertCmd)
goto empty_func;
const char *onam = funcPtr->name;
// if (!onam) // Override blank name with last index.
// funcPtr->name = lpv;
if (funcPtr->name && funcPtr->name[0] && funcPtr->type == FC_NORMAL)
interp->curFunction = funcPtr->name;
adds = funcPtr->callflags.bits.addargs;
Jsi_CmdSpec *cs = funcPtr->cmdSpec;
if (adds && (cs->flags&JSI_CMDSPEC_NONTHIS))
adds = 0;
Jsi_Func *pprevActive = interp->prevActiveFunc, *prevActive = interp->prevActiveFunc = interp->activeFunc;
interp->activeFunc = funcPtr;
rc = jsi_SharedArgs(interp, args, funcPtr, 1); /* make arg vars to share arguments */
if (rc != JSI_OK)
goto bail;
funcPtr->callflags.bits.addargs = 0;
jsi_InitLocalVar(interp, args, funcPtr);
jsi_SetCallee(interp, args, tocall);
pkg = funcPtr->pkg;
tc = interp->traceCall;
if (pkg) {
tc |= pkg->popts.modConf.traceCall;
profile |= pkg->popts.modConf.profile;
coverage |= pkg->popts.modConf.coverage;
}
if (as_constructor) { /* new Constructor */
Jsi_Obj *newobj = Jsi_ObjNewType(interp, JSI_OT_OBJECT);
Jsi_Value *proto = NULL;
if (!interp->subOpts.noproto)
proto = Jsi_ValueObjLookup(interp, tocall, "prototype", 0);
if (proto && proto->vt == JSI_VT_OBJECT) {
newobj->__proto__ = proto;
newobj->clearProto = 1;
Jsi_IncrRefCount(interp, proto);
}
Jsi_ValueReset(interp, &_this);
Jsi_ValueMakeObject(interp, &_this, newobj);
/* TODO: constructor specifics??? */
calltrc = (tc&jsi_callTraceNew);
}
if (funcPtr->type == FC_NORMAL)
calltrc = (tc&jsi_callTraceFuncs);
else
calltrc = (tc&jsi_callTraceCmds);
if (calltrc && funcPtr->name)
jsi_TraceFuncCall(interp, funcPtr, ip, _this, args, 0, tc);
//Jsi_Value *spretPtr = *ret;
interp->activeFunc = funcPtr;
docall = (rc==JSI_OK);
if (profile || coverage) {
interp->profileCnt++;
timStart = jsi_GetTimestamp();
}
if (funcPtr->type == FC_NORMAL) {
if (docall) {
rc = jsi_evalcode(interp->ps, funcPtr, funcPtr->opcodes, tocall->d.obj->d.fobj->scope,
args, _this, ret);
}
interp->funcCallCnt++;
} else if (!funcPtr->callback) {
Jsi_LogError("can not call:\"%s()\"", funcPtr->name);
} else {
int oldcf = funcPtr->callflags.i;
funcPtr->callflags.bits.iscons = (as_constructor?JSI_CALL_CONSTRUCTOR:0);
if (funcPtr->f.bits.hasattr)
{
#define SPTR(s) (s?s:"")
if ((funcPtr->f.bits.isobj) && _this->vt != JSI_VT_OBJECT) {
rc = JSI_ERROR;
docall = 0;
Jsi_LogError("'this' is not object: \"%s()\"", funcPtr->name);
} else if ((!(funcPtr->f.bits.iscons)) && as_constructor) {
rc = JSI_ERROR;
docall = 0;
Jsi_LogError("can not call as constructor: \"%s()\"", funcPtr->name);
} else {
int aCnt = Jsi_ValueGetLength(interp, args);
if (aCnt<(cs->minArgs+adds)) {
Jsi_LogError("missing args, expected \"%s(%s)\" ", cs->name, SPTR(cs->argStr));
rc = JSI_ERROR;
docall = 0;
} else if (cs->maxArgs>=0 && (aCnt>cs->maxArgs+adds)) {
Jsi_LogError("extra args, expected \"%s(%s)\" ", cs->name, SPTR(cs->argStr));
rc = JSI_ERROR;
docall = 0;
}
}
}
if (docall) {
funcPtr->fobj = fobj; // Backlink for bind.
funcPtr->callflags.bits.isdiscard = discard;
rc = funcPtr->callback(interp, args,
_this, ret, funcPtr);
interp->cmdCallCnt++;
}
funcPtr->callflags.i = oldcf;
}
if (profile || coverage) {
double timEnd = jsi_GetTimestamp(), timUsed = (timEnd - timStart);;
assert(timUsed>=0);
funcPtr->allTime += timUsed;
if (interp->framePtr->evalFuncPtr)
interp->framePtr->evalFuncPtr->subTime += timUsed;
else
interp->subTime += timUsed;
}
if (calltrc && (tc&jsi_callTraceReturn) && funcPtr->name)
jsi_TraceFuncCall(interp, funcPtr, ip, _this, NULL, *ret, tc);
if (!onam)
funcPtr->name = NULL;
if (docall) {
funcPtr->callCnt++;
if (rc == JSI_OK && !as_constructor && funcPtr->retType && (interp->typeCheck.all || interp->typeCheck.run))
rc = jsi_ArgTypeCheck(interp, funcPtr->retType, *ret, "returned from", funcPtr->name, 0, funcPtr, 0);
}
interp->prevActiveFunc = pprevActive;
interp->activeFunc = prevActive;
if (as_constructor) {
if (_this->vt == JSI_VT_OBJECT)
_this->d.obj->constructor = tocall->d.obj;
if ((*ret)->vt != JSI_VT_OBJECT) {
Jsi_ValueReset(interp, ret);
Jsi_ValueCopy(interp, *ret, _this);
}
}
bail:
jsi_SharedArgs(interp, args, funcPtr, 0); /* make arg vars to shared arguments */
Jsi_DecrRefCount(interp, _this);
interp->curFunction = oldCurFunc;
return rc;
} | 303,880,079,257,195,560,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,390 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int dbGetIntBool(Jsi_Interp *interp, Jsi_Value* v)
{
if (Jsi_ValueIsNumber(interp, v)) {
Jsi_Number d;
Jsi_ValueGetNumber(interp, v, &d);
return (int)d;
}
if (Jsi_ValueIsBoolean(interp, v)) {
bool n;
Jsi_ValueGetBoolean(interp, v, &n);
return n;
}
return 0;
} | 119,581,689,553,807,220,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,391 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int JsiNumberBase(const char *str, int *base, int *sign)
{
int i = 0;
*base = 10;
while (isspace(UCHAR(str[i]))) {
i++;
}
if (str[i] == '-') {
*sign = -1;
i++;
}
else {
if (str[i] == '+') {
i++;
}
*sign = 1;
}
if (str[i] != '0') {
/* base 10 */
return 0;
}
/* We have 0<x>, so see if we can convert it */
switch (str[i + 1]) {
case 'x': case 'X': *base = 16; break;
case 'o': case 'O': *base = 8; break;
case 'b': case 'B': *base = 2; break;
default: return 0;
}
i += 2;
/* Ensure that (e.g.) 0x-5 fails to parse */
if (str[i] != '-' && str[i] != '+' && !isspace(UCHAR(str[i]))) {
/* Parse according to this base */
return i;
}
/* Parse as base 10 */
return 10;
} | 7,611,451,100,002,841,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,392 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | char jsi_toHexChar(char code) {
static char hex[] = "0123456789abcdef";
return hex[code & 15];
} | 222,158,151,514,231,840,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,393 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | int jsi_PstateSetFile(jsi_Pstate *ps, Jsi_Channel fp, int skipbang)
{
jsi_Lexer *l = ps->lexer;
jsi_PstateClear(ps);
l->ltype = LT_FILE;
l->d.fp = fp;
Jsi_Rewind(ps->interp, fp);
if (skipbang) {
char buf[JSI_BUFSIZ];
if (Jsi_Gets(ps->interp, fp, buf, sizeof(buf)) && (buf[0] != '#' || buf[1] != '!')) {
Jsi_Rewind(ps->interp, fp);
}
}
return JSI_OK;
} | 287,369,570,769,961,560,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,394 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void jsi_PstateClear(jsi_Pstate *ps)
{
jsi_Lexer* l = ps->lexer;
if (l->ltype == LT_FILE)
{
if (l->d.fp)
Jsi_Close(ps->interp, l->d.fp);
l->d.fp = NULL;
}
if (l->ltype == LT_STRING)
{
l->d.str = NULL;
}
l->ltype = LT_NONE;
l->last_token = 0;
l->cur_line = 1;
l->cur_char = 0;
l->cur = 0;
ps->err_count = 0;
} | 288,200,771,210,603,330,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,395 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void *Jsi_StackPeek(Jsi_Stack *stack)
{
if (stack->len == 0)
return NULL;
return stack->vector[stack->len - 1];
} | 227,059,013,268,674,500,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,396 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_RC Jsi_FunctionInvokeJSON(Jsi_Interp *interp, Jsi_Value *func, const char *json, Jsi_Value **ret)
{
if (!Jsi_ValueIsFunction(interp, func))
return JSI_ERROR;
Jsi_Value *aPtr = Jsi_ValueNew1(interp);
Jsi_RC rc = Jsi_JSONParse(interp, json, &aPtr, 0);
if (rc == JSI_OK)
rc = Jsi_FunctionInvoke(interp, func, aPtr, ret, NULL);
Jsi_DecrRefCount(interp, aPtr);
return rc;
} | 300,052,382,340,409,340,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,397 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int jsi_wsServeString(jsi_wsPss *pss, struct lws *wsi,
const char *buf, int code, const char *extra, const char *mime)
{
int strLen = Jsi_Strlen(buf);
Jsi_DString jStr = {};
int rc = jsi_wsServeHeader(pss, wsi, strLen, code, extra, mime, &jStr);
if (rc>=0) {
Jsi_DSAppend(&jStr, buf, NULL);
char *vStr = Jsi_DSValue(&jStr);
int vLen = Jsi_DSLength(&jStr);
rc = jsi_wswrite(pss, wsi, (unsigned char*)vStr, vLen, LWS_WRITE_HTTP);
}
Jsi_DSFree(&jStr);
return (rc>=0?1:0);
} | 209,263,325,510,389,330,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,398 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_Regex* Jsi_RegExpNew(Jsi_Interp *interp, const char *regtxt, int eflag)
{
bool isNew;
Jsi_HashEntry *hPtr;
int flag = REG_EXTENDED;
char c, *cm, *ce;
const char *cp;
Jsi_Regex *re;
if (interp->subOpts.noRegex) {
Jsi_LogError("regex disabled for interp");
return NULL;
}
eflag |= JSI_REG_STATIC;
if (!regtxt[0])
return NULL;
hPtr = Jsi_HashEntryFind(interp->regexpTbl, regtxt);
if (hPtr) {
re = (Jsi_Regex*)Jsi_HashValueGet(hPtr);
if (JSI_REG_STATIC & eflag)
re->eflags |= JSI_REG_STATIC;
return re;
}
cp = regtxt+1;
if (regtxt[0] != '/')
return NULL;
ce = (char*)Jsi_Strrchr(cp, '/');
if (ce == cp || !ce)
return NULL;
cm = ce + 1;
while (*cm) {
c = *cm++;
if (c == 'i') flag |= REG_ICASE;
else if (c == 'g') eflag |= JSI_REG_GLOB;
else if (c == 'm') { /* PERL NON-STANDARD */
eflag |= JSI_REG_NEWLINE;
flag |= REG_NEWLINE;
}
#ifdef RE_DOT_NEWLINE
else if (c == 's') { /* PERL NON-STANDARD */
eflag |= JSI_REG_DOT_NEWLINE;
flag |= RE_DOT_NEWLINE;
}
#endif
}
*ce = 0;
regex_t reg;
if (regcomp(®, cp, flag)) {
*ce++ = '/';
Jsi_LogError("Invalid regex string '%s'", cp);
return NULL;
}
*ce++ = '/';
re = (Jsi_Regex*)Jsi_Calloc(1, sizeof(Jsi_Regex));
SIGINIT(re, REGEXP);
assert (re);
re->reg = reg;
re->eflags = eflag;
re->flags = flag;
hPtr = Jsi_HashEntryNew(interp->regexpTbl, regtxt, &isNew);
assert(hPtr);
Jsi_HashValueSet(hPtr, re);
re->pattern = (char*)Jsi_HashKeyGet(hPtr);
return re;
} | 199,338,178,775,704,000,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,400 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void Jsi_ValueFromDS(Jsi_Interp *interp, Jsi_DString *dsPtr, Jsi_Value **ret)
{
char *cp = NULL;
int len = Jsi_DSLength(dsPtr);
if (len && !(cp=(char*)dsPtr->strA))
cp = Jsi_StrdupLen(dsPtr->Str, len);
dsPtr->strA = NULL;
dsPtr->Str[0] = 0;
dsPtr->len = 0;
dsPtr->spaceAvl = dsPtr->staticSize;
if (!cp)
Jsi_ValueMakeStringDup(interp, ret, "");
else
Jsi_ValueMakeBlob(interp, ret, (uchar*)cp, len);
} | 205,294,595,114,075,300,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,401 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static bool sqliteObjIsTrue(void *data)
{
Jsi_Db *db = (Jsi_Db*)data;
SQLSIGASSERT(db,DB);
if (!db->db) return 0;
else return 1;
} | 54,442,341,622,951,840,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,402 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void insert_case1(Jsi_TreeEntry* n) {
if (n->parent == NULL)
set_color(n, _JSI_TREE_BLACK);
else
insert_case2(n);
} | 254,330,878,464,250,300,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,403 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_Filesystem* Jsi_FilesystemForPath(Jsi_Interp *interp, Jsi_Value* path, void**clientDataPtr) {
FSList *fsl = jsiFSList;
if (!fsl) return NULL;
clientDataPtr = NULL;
const char *pathStr = Jsi_ValueToString(interp, path, NULL);
if (!pathStr || pathStr[0] == '~')
return &jsiFilesystem;
if (pathStr[0] == '.' && pathStr[1] == 0)
return (jsiIntData.cwdFsPtr ? jsiIntData.cwdFsPtr : &jsiFilesystem);
Jsi_Value *tpath = NULL;
if (Jsi_Strstr(pathStr, "..")) {
Jsi_DString dStr;
Jsi_DSInit(&dStr);
pathStr = Jsi_ValueNormalPath(interp, path, &dStr);
tpath = path = Jsi_ValueNewStringDup(interp, pathStr);
Jsi_IncrRefCount(interp, tpath);
Jsi_DSFree(&dStr);
}
while (1) {
if (fsl->fsPtr->pathInFilesystemProc && fsl->fsPtr->pathInFilesystemProc(interp, path, clientDataPtr))
break;
if (!fsl->next)
break;
fsl = fsl->next;
}
if (tpath)
Jsi_DecrRefCount(interp, tpath);
return (fsl ? fsl->fsPtr : &jsiFilesystem);
} | 96,070,812,091,281,780,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,404 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_TreeEntry *Jsi_TreeSearchFirst (Jsi_Tree *treePtr, Jsi_TreeSearch *searchPtr, int flags, const void *startKey)
{
Jsi_TreeEntry *hPtr = NULL, *hPtr2 = NULL;
if (!treePtr) return NULL;
memset(searchPtr, 0, sizeof(*searchPtr));
searchPtr->treePtr = treePtr;
searchPtr->flags = flags;
searchPtr->Ptrs = searchPtr->staticPtrs;
searchPtr->max = sizeof(searchPtr->staticPtrs)/sizeof(searchPtr->staticPtrs[0]);
searchPtr->epoch = treePtr->epoch;
if (startKey || (flags & JSI_TREE_SEARCH_KEY))
hPtr2 = Jsi_TreeEntryFind(treePtr, startKey);;
searchPtr->current = treePtr->root;
hPtr = searchAdd(searchPtr, treePtr->root);
if (hPtr2 && hPtr && hPtr2 != hPtr)
while (hPtr && hPtr2 != hPtr) // TODO: need a more efficient way to do this...
hPtr = Jsi_TreeSearchNext(searchPtr);
return hPtr;
} | 247,763,266,684,466,900,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,405 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | uint Jsi_TreeSize(Jsi_Tree *treePtr) { return treePtr->numEntries; } | 95,054,895,825,424,300,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,406 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_Value *jsi_MakeFuncValueSpec(Jsi_Interp *interp, Jsi_CmdSpec *cmdSpec, void *privData)
{
Jsi_Obj *o = Jsi_ObjNew(interp);
Jsi_Func *f = jsi_FuncNew(interp);
o->ot = JSI_OT_FUNCTION;
f->type = FC_BUILDIN;
f->cmdSpec = cmdSpec;
f->callback = cmdSpec->proc;
f->privData = privData;
f->f.flags = (cmdSpec->flags & JSI_CMD_MASK);
f->script = interp->curFile;
o->d.fobj = jsi_FuncObjNew(interp, f);
return Jsi_ValueMakeObject(interp, NULL, o);
} | 304,795,091,133,401,200,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,407 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | void Jsi_InterpOnDelete(Jsi_Interp *interp, Jsi_DeleteProc *freeProc, void *ptr)
{
if (freeProc)
Jsi_HashSet(interp->onDeleteTbl, ptr, (void*)freeProc);
else {
Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->onDeleteTbl, ptr);
if (hPtr)
Jsi_HashEntryDelete(hPtr);
}
} | 283,996,850,781,844,000,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,408 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int node_color(Jsi_TreeEntry* n) {
return n == NULL ? _JSI_TREE_BLACK : n->f.bits.color;
} | 124,436,547,601,216,740,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,409 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_OpCodes *code_newfcall(jsi_Pstate *p, jsi_Pline *line, int argc, const char *name, Jsi_OpCodes *argCodes) {
jsi_FuncCallCheck(p,line,argc,1, name, NULL, argCodes); JSI_NEW_CODESLN(0,OP_NEWFCALL, argc);
} | 329,106,405,131,720,800,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,410 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | int Jsi_Read(Jsi_Interp *interp, Jsi_Channel chan, char *bufPtr, int toRead) {
if (chan->fsPtr==0 || !chan->fsPtr->readProc) return -1;
return chan->fsPtr->readProc(chan, bufPtr, toRead);
} | 207,955,138,231,349,720,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,411 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | char* Jsi_ValueNormalPath(Jsi_Interp *interp, Jsi_Value *file, Jsi_DString *dStr) {
return Jsi_NormalPath(interp, Jsi_ValueString(interp, file, NULL), dStr);
} | 113,742,830,853,878,580,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,412 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static void dbDeleteCmd(Jsi_Db *jdb)
{
Jsi_Interp *interp = jdb->interp;
if (jdb->debug & TMODE_DELETE)
JSI_DBQUERY_PRINTF( "DEBUG: delete\n");
dbFlushStmtCache(jdb);
if (jdb->stmtHash)
Jsi_HashDelete(jdb->stmtHash);
//closeIncrblobChannels(jdb);
if (jdb->db) {
DbClose(jdb->db);
}
while( jdb->pFunc ) {
SqlFunc *pFunc = jdb->pFunc;
jdb->pFunc = pFunc->pNext;
Jsi_DSFree(&pFunc->dScript);
Jsi_DecrRefCount(interp, pFunc->tocall);
Jsi_Free((char*)pFunc);
}
while( jdb->pCollate ) {
SqlCollate *pCollate = jdb->pCollate;
jdb->pCollate = pCollate->pNext;
Jsi_Free((char*)pCollate);
}
Jsi_OptionsFree(interp, SqlOptions, jdb, 0);
if (jdb->stmtCache)
Jsi_ListDelete(jdb->stmtCache);
} | 1,217,036,516,003,810,900,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,413 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static bool fileObjEqual(void *data1, void *data2)
{
return (data1 == data2);
} | 93,874,334,815,994,610,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,414 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_ListEntry* Jsi_ListSearchNext (Jsi_ListSearch *searchPtr)
{
Jsi_ListEntry *lptr = searchPtr->nextEntryPtr;
searchPtr->nextEntryPtr = (lptr?(searchPtr->flags & JSI_LIST_REVERSE ? Jsi_ListEntryPrev(lptr): Jsi_ListEntryNext(lptr)):NULL);
return lptr;
} | 13,550,387,508,685,373,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |