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,615 | 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_Mutex* Jsi_MutexNew(Jsi_Interp *interp, int timeout, int flags) {
Jsi_Mutex *mtx = (Jsi_Mutex *)Jsi_Calloc(1,sizeof(Jsi_Mutex));
mtx->lockTimeout = timeout;
mtx->flags = flags;
MutexInit(mtx);
return mtx;
} | 229,329,683,978,447,360,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,616 | 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 FilesysModeCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
UdfGet(udf, _this, funcPtr);
if (udf->mode)
Jsi_ValueMakeStringKey(interp, ret, udf->mode);
return JSI_OK;
} | 211,783,560,939,776,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,617 | 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_PathNormalize(Jsi_Interp *interp, Jsi_Value **pathPtr) {
Jsi_Value *path = *pathPtr;
if (!path) {
Jsi_DString dStr = {};
*pathPtr = Jsi_ValueNewStringDup(interp, Jsi_GetCwd(interp, &dStr));
Jsi_IncrRefCount(interp, *pathPtr);
Jsi_DSFree(&dStr);
} else {
const char *rn = Jsi_Realpath(interp, path, NULL);
if (!rn) return JSI_ERROR;
Jsi_DecrRefCount(interp, *pathPtr);
*pathPtr = Jsi_ValueNewString(interp, rn, -1);
Jsi_IncrRefCount(interp, *pathPtr);
}
return JSI_OK;
} | 32,697,593,232,613,053,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,618 | 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 | HashString( const char *string)
{
jsi_Hash result = 0;
jsi_Hash c;
while ((c = *string++) != 0)
result += (result << 3) + c;
return (jsi_Hash)result;
} | 261,154,446,402,662,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,619 | 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 MutexLock(Jsi_Interp *interp, Jsi_Mutex* mtx) {
int timeout = mtx->lockTimeout;
if (interp && timeout<0)
timeout = interp->lockTimeout;
if (timeout<=0)
EnterCriticalSection(&mtx->mtx);
else {
int cnt = timeout;
while (cnt-- >= 0) {
if (TryEnterCriticalSection(&mtx->mtx))
return JSI_OK;
usleep(1000);
}
Jsi_LogError("lock timed out");
if (interp)
interp->threadErrCnt++;
mtx->threadErrCnt++;
return JSI_ERROR;
}
return JSI_OK;
} | 240,602,132,433,312,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,620 | 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_jfalse_np(int off) { JSI_NEW_CODES(0,OP_JFALSE_NP, off); } | 156,655,668,905,669,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,621 | 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 jsiEvalOp(Jsi_Interp* interp, jsi_Pstate *ps, char *program,
jsi_ScopeChain *scope, Jsi_Value *currentScope, Jsi_Value *_this, Jsi_Value **ret)
{
Jsi_RC r = JSI_OK;
jsi_Pstate *newps = jsiNewParser(interp, program, NULL, 1);
if (newps) {
int oef = newps->eval_flag;
newps->eval_flag = 1;
interp->ps = newps;
r = jsi_evalcode(newps, NULL, newps->opcodes, scope, currentScope, _this, ret);
if (r) {
Jsi_ValueDup2(interp, &ps->last_exception, newps->last_exception);
}
newps->eval_flag = oef;
interp->ps = ps;
} else {
//Jsi_ValueMakeStringKey(interp, &ps->last_exception, "Syntax Error");
r = JSI_ERROR;
}
return r;
} | 158,621,934,556,777,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,622 | 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 dbPrepStmtFree( Jsi_Db *jdb, SqlPreparedStmt *prep)
{
if (prep->deleting)
return;
prep->deleting = 1;
if (prep->pStmt)
sqlite3_finalize( prep->pStmt );
if (prep->entry) {
Jsi_HashEntry *hPtr = prep->entry;
prep->entry = NULL;
Jsi_HashEntryDelete(hPtr);
}
if (prep->elPtr)
Jsi_ListEntryDelete(prep->elPtr);
Jsi_Free( (char*)prep );
jdb->stmtCacheCnt--;
} | 251,170,101,551,739,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,623 | 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_notequal() { JSI_NEW_CODES(0,OP_NOTEQUAL, 0); } | 61,567,490,585,867,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,624 | 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 FilesysReadCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
int sum = 0, n;
Jsi_DString dStr;
Jsi_DSInit(&dStr);
UdfGet(udf, _this, funcPtr);
char buf[JSI_BUFSIZ];
int argc = Jsi_ValueGetLength(interp, args);
int nsiz = -1, cnt = 0, rsiz;
if (!udf->filename) {
goto bail;
}
if (argc>0 && Jsi_GetIntFromValue(interp, Jsi_ValueArrayIndex(interp, args, 0), &nsiz) != JSI_OK)
goto bail;
while (cnt++ < MAX_LOOP_COUNT) {
rsiz = sizeof(buf);
if (nsiz>0 && ((sum+rsiz)>nsiz))
rsiz = (nsiz-sum);
if ((n = Jsi_Read(interp, udf->chan, buf, rsiz)) <= 0)
break;
Jsi_DSAppendLen(&dStr, buf, n);
sum += n;
if (nsiz>=0 && sum >=nsiz)
break;
}
if (Jsi_DSLength(&dStr)>0)
Jsi_ValueMakeDStringObject(interp, ret, &dStr);
return JSI_OK;
bail:
Jsi_DSFree(&dStr);
Jsi_ValueMakeUndef(interp, ret);
return JSI_OK;
} | 118,509,706,883,351,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,625 | 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_TreeKeysDump(Jsi_Interp *interp, Jsi_Tree *tablePtr, Jsi_Value **ret, int flags) {
char *key;
int n = 0;
Jsi_TreeEntry *hPtr;
Jsi_TreeSearch search;
Jsi_Obj *nobj;
Jsi_MapFmtKeyProc* fmtKeyProc = tablePtr->opts.fmtKeyProc;
if (!fmtKeyProc && tablePtr->keyType == JSI_KEYS_ONEWORD && flags!=JSI_KEYS_ONEWORD )
fmtKeyProc = jsi_treeFmtKey;
if (!fmtKeyProc && tablePtr->keyType >= JSI_KEYS_STRUCT_MINSIZE)
return Jsi_LogError("Can not dump struct tree");
nobj = Jsi_ObjNew(interp);
Jsi_ValueMakeArrayObject(interp, ret, nobj);
for (hPtr = Jsi_TreeSearchFirst(tablePtr, &search, flags, NULL);
hPtr != NULL; hPtr = Jsi_TreeSearchNext(&search)) {
key = (char*)Jsi_TreeKeyGet(hPtr);
Jsi_Value *val;
if (fmtKeyProc) {
val = (*fmtKeyProc)((Jsi_MapEntry*)hPtr, &tablePtr->opts, flags);
if (!val) {
Jsi_LogError("key format failed");
Jsi_ValueMakeUndef(interp, ret);
return JSI_ERROR;
}
} else if (tablePtr->keyType == JSI_KEYS_ONEWORD)
val = Jsi_ValueNewNumber(interp, (Jsi_Number)(uintptr_t)key);
else
val = Jsi_ValueNewStringKey(interp, key);
Jsi_ObjArraySet(interp, nobj, val, n++);
if (fmtKeyProc && val->refCnt>1) //TODO: Hmmm. for StructKey Jsi_OptionsDump() returns refCnt=1
Jsi_DecrRefCount(interp, val);
}
Jsi_TreeSearchDone(&search);
return JSI_OK;
} | 71,632,374,869,623,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,626 | 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_Remove(Jsi_Interp *interp, Jsi_Value* path, int flags) {
void *data;
Jsi_Filesystem *fsPtr = Jsi_FilesystemForPath(interp, path, &data);
if (fsPtr == NULL || !fsPtr->removeProc) return -1;
return fsPtr->removeProc(interp, path, flags);
} | 164,802,149,897,242,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,627 | 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_ValueGetDString(Jsi_Interp *interp, Jsi_Value* v, Jsi_DString *dStr, int quote)
{
objwalker ow;
ow.quote = quote;
ow.depth = 0;
ow.dStr = dStr;
jsiValueGetString(interp, v, dStr, &ow);
return Jsi_DSValue(dStr);
} | 162,947,400,786,824,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,628 | 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 jsiSqlFunc(sqlite3_context *context, int argc, sqlite3_value**argv) {
SqlFunc *p = (SqlFunc*)sqlite3_user_data(context);
int i;
int rc;
Jsi_Interp *interp = p->interp;
Jsi_Value *vpargs, *itemsStatic[100], **items = itemsStatic, *ret;
if (argc>100)
items = (Jsi_Value**)Jsi_Calloc(argc, sizeof(Jsi_Value*));
for(i=0; i<argc; i++) {
items[i] = dbGetValueGet(interp, argv[i]);
}
vpargs = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, items, argc, 0));
Jsi_IncrRefCount(interp, vpargs);
ret = Jsi_ValueNew1(interp);
rc = Jsi_FunctionInvoke(interp, p->tocall, vpargs, &ret, NULL);
Jsi_DecrRefCount(interp, vpargs);
if (items != itemsStatic)
Jsi_Free(items);
bool b;
if( rc != JSI_OK) {
char buf[JSI_BUFSIZ];
snprintf(buf, sizeof(buf), "error in function: %.200s", p->zName);
sqlite3_result_error(context, buf, -1);
} else if (Jsi_ValueIsBoolean(interp, ret)) {
Jsi_GetBoolFromValue(interp, ret, &b);
sqlite3_result_int(context, b);
} else if (Jsi_ValueIsNumber(interp, ret)) {
Jsi_Number d;
// if (Jsi_GetIntFromValueBase(interp, ret, &i, 0, JSI_NO_ERRMSG);
// sqlite3_result_int64(context, v);
Jsi_GetNumberFromValue(interp, ret, &d);
sqlite3_result_double(context, (double)d);
} else {
const char * data;
if (!(data = Jsi_ValueGetStringLen(interp, ret, &i))) {
//TODO: handle objects???
data = Jsi_ValueToString(interp, ret, NULL);
i = Jsi_Strlen(data);
}
sqlite3_result_text(context, (char *)data, i, SQLITE_TRANSIENT );
}
Jsi_DecrRefCount(interp, ret);
} | 286,851,602,931,369,240,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,629 | 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_Mutex* Jsi_MutexNew(Jsi_Interp *interp, int timeout, int flags) { return NULL; } | 118,650,348,236,458,890,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,630 | 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_treeFmtKey(Jsi_MapEntry* h, struct Jsi_MapOpts *opts, int flags)
{
Jsi_TreeEntry* hPtr = (Jsi_TreeEntry*)h;
void *key = Jsi_TreeKeyGet(hPtr);
if (opts->keyType == JSI_KEYS_ONEWORD)
return Jsi_ValueNewNumber(opts->interp, (Jsi_Number)(intptr_t)key);
char nbuf[JSI_MAX_NUMBER_STRING];
snprintf(nbuf, sizeof(nbuf), "%p", key);
return Jsi_ValueNewStringDup(opts->interp, nbuf);
} | 297,726,210,999,372,760,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,631 | 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_FSGetcProc(Jsi_Channel chan) {
return fgetc(_JSI_GETFP(chan,1));
} | 237,012,116,154,785,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,632 | 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 WebSocketHandlerCmd(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);
Jsi_HashEntry *hPtr;
jsi_wsHander *hdlPtr;
if (!cmdPtr)
return Jsi_LogError("Apply in a non-websock object");
WSSIGASSERT(cmdPtr, OBJ);
int argc = Jsi_ValueGetLength(interp, args);
if (argc == 0) {
Jsi_HashSearch search;
Jsi_Obj* obj = Jsi_ObjNew(interp);
for (hPtr = Jsi_HashSearchFirst(cmdPtr->handlers, &search); hPtr; hPtr = Jsi_HashSearchNext(&search)) {
const char *key = (char*)Jsi_HashKeyGet(hPtr);
Jsi_Value *val = (Jsi_Value*)Jsi_HashValueGet(hPtr);
Jsi_ObjInsert(interp, obj, key, val, 0);
}
Jsi_ValueMakeObject(interp, ret, obj);
return JSI_OK;
}
if (argc == 1) {
hPtr = Jsi_HashEntryFind(cmdPtr->handlers, Jsi_ValueArrayIndexToStr(interp, args, 0, NULL));
if (!hPtr)
return JSI_OK;
hdlPtr = (jsi_wsHander*)Jsi_HashValueGet(hPtr);
Jsi_ValueReplace(interp, ret, hdlPtr->val);
return JSI_OK;
}
const char *key = Jsi_ValueArrayIndexToStr(interp, args, 0, NULL);
Jsi_Value *valPtr = Jsi_ValueArrayIndex(interp, args, 1);
if (Jsi_ValueIsNull(interp, valPtr)) {
hPtr = Jsi_HashEntryFind(cmdPtr->handlers, key);
if (!hPtr)
return JSI_OK;
hdlPtr = (jsi_wsHander*)Jsi_HashValueGet(hPtr);
if (hdlPtr->val)
Jsi_DecrRefCount(interp, hdlPtr->val);
Jsi_HashValueSet(hPtr, NULL);
Jsi_HashEntryDelete(hPtr);
Jsi_Free(hdlPtr);
Jsi_ValueMakeStringDup(interp, ret, key);
return JSI_OK;
}
if (Jsi_ValueIsFunction(interp, valPtr)==0 && Jsi_ValueIsString(interp, valPtr)==0)
return Jsi_LogError("expected string, function or null");
Jsi_Value *argPtr = Jsi_ValueArrayIndex(interp, args, 2);
if (argPtr) {
if (Jsi_ValueIsNull(interp, argPtr))
argPtr = NULL;
else if (!Jsi_ValueIsString(interp, argPtr))
return Jsi_LogError("expected a string");
}
hPtr = Jsi_HashEntryNew(cmdPtr->handlers, key, NULL);
if (!hPtr)
return JSI_ERROR;
hdlPtr = (jsi_wsHander *)Jsi_Calloc(1, sizeof(*hdlPtr));
Jsi_Value *flagPtr = Jsi_ValueArrayIndex(interp, args, 1);
Jsi_Number fl = 0;
if (flagPtr && Jsi_ValueIsNumber(interp, flagPtr))
Jsi_ValueGetNumber(interp, flagPtr, &fl);
hdlPtr->val = valPtr;
hdlPtr->flags = fl;
Jsi_HashValueSet(hPtr, hdlPtr);
Jsi_IncrRefCount(interp, valPtr);
return JSI_OK;
} | 217,169,774,480,061,960,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,633 | 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_ValueNew(Jsi_Interp *interp, const char *fname, int line, const char *func) {
Jsi_Value *v = ValueNew(interp);
jsi_ValueDebugUpdate(interp, v, valueDebugTbl, fname, line, func);
return v;
} | 86,046,012,356,215,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,634 | 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_evalcode_sub(jsi_Pstate *ps, Jsi_OpCodes *opcodes,
jsi_ScopeChain *scope, Jsi_Value *currentScope,
Jsi_Value *_this, Jsi_Value *vret)
{
Jsi_Interp* interp = ps->interp;
jsi_OpCode *ip = &opcodes->codes[0];
Jsi_RC rc = JSI_OK;
int curLine = 0;
int context_id = ps->_context_id++, lop = -1;
jsi_OpCode *end = &opcodes->codes[opcodes->code_len];
jsi_TryList *trylist = NULL;
bool strict = interp->strict;
const char *curFile = NULL;
if (currentScope->vt != JSI_VT_OBJECT) {
Jsi_LogBug("Eval: current scope is not a object");
return JSI_ERROR;
}
if (interp->maxDepth>0 && interp->level > interp->maxDepth)
rc = Jsi_LogError("Exceeded call depth: %d", interp->level);
while(ip < end && rc == JSI_OK) {
int plop = ip->op;
if (ip->logflag) { // Mask out LogDebug, etc if not enabled.
interp->curIp = ip;
switch (ip->logflag) {
case jsi_Oplf_assert:
if (!interp->asserts) {
ip++;
if (ip->logflag != jsi_Oplf_assert && (ip->op == OP_POP || ip->op == OP_RET))
ip++;
continue;
}
break;
case jsi_Oplf_debug:
if (!interp->logOpts.Debug && !(interp->framePtr->logflag &(1<<jsi_Oplf_debug))) {
ip++;
if (ip->logflag != jsi_Oplf_debug && (ip->op == OP_POP || ip->op == OP_RET))
ip++;
continue;
}
break;
case jsi_Oplf_test:
if (!interp->logOpts.Test && !(interp->framePtr->logflag &(1<<jsi_Oplf_test))) {
ip++;
if (ip->logflag != jsi_Oplf_test && (ip->op == OP_POP || ip->op == OP_RET))
ip++;
continue;
}
break;
case jsi_Oplf_trace:
if (!interp->logOpts.Trace && !(interp->framePtr->logflag &(1<<jsi_Oplf_trace))) {
ip++;
if (ip->logflag != jsi_Oplf_trace && (ip->op == OP_POP || ip->op == OP_RET))
ip++;
continue;
}
break;
default:
break;
}
}
if (interp->interrupted) {
if (!interp->framePtr->tryDepth) {
Jsi_LogError("program interrupted: function=%s", interp->framePtr->funcName);
interp->interrupted = 0;
} else {
interp->interrupted++;
}
rc = JSI_ERROR;
break;
}
if (interp->exited) {
rc = JSI_ERROR;
break;
}
interp->opCnt++;
if (interp->maxOpCnt && interp->opCnt > interp->maxOpCnt) {
puts("EXEC CAP EXCEED");
interp->maxOpCnt += 1000;
rc = Jsi_LogError("Exceeded execution cap: %d", interp->opCnt);
interp->exited = 1;
interp->exitCode = 99;
break;
}
if (interp->traceOp) {
jsiDumpInstr(interp, ps, _this, trylist, ip, opcodes);
}
if (interp->parent && interp->busyCallback && (interp->opCnt%(interp->busyInterval<=0?100000:interp->busyInterval))==0) {
// Handle parent interp events.
if (jsi_FuncIsNoop(interp, interp->busyCallback))
Jsi_EventProcess(interp->parent, -1);
else {
Jsi_DString nStr;
Jsi_DSInit(&nStr);
Jsi_DSPrintf(&nStr, "[\"#Interp_%d\", %d]", interp->objId, interp->opCnt);//TODO: use actual time interval rather than opCnt.
if (Jsi_FunctionInvokeJSON(interp->parent, interp->busyCallback, Jsi_DSValue(&nStr), NULL) != JSI_OK)
rc = JSI_ERROR;
Jsi_DSFree(&nStr);
}
}
ip->hit=1;
#ifndef USE_STATIC_STACK
if ((interp->maxStack-interp->framePtr->Sp)<STACK_MIN_PAD)
jsiSetupStack(interp);
#endif
jsiPush(interp,0);
interp->curIp = ip;
// Carry forward line/file info from previous OPs.
if (!ip->Line)
ip->Line = curLine;
else
curLine = ip->Line;
if (!ip->fname)
ip->fname = curFile;
else
curFile = ip->fname;
if (interp->debugOpts.hook) {
interp->framePtr->fileName = curFile;
interp->framePtr->line = curLine;
if ((rc = (*interp->debugOpts.hook)(interp, curFile, curLine, interp->framePtr->level, interp->curFunction, jsi_opcode_string(ip->op), ip, NULL)) != JSI_OK)
break;
}
switch(ip->op) {
case OP_NOP:
case OP_LASTOP:
break;
case OP_PUSHUND:
Jsi_ValueMakeUndef(interp, &_jsi_STACKIDX(interp->framePtr->Sp));
jsiPush(interp,1);
break;
case OP_PUSHNULL:
Jsi_ValueMakeNull(interp, &_jsi_STACKIDX(interp->framePtr->Sp));
jsiPush(interp,1);
break;
case OP_PUSHBOO:
Jsi_ValueMakeBool(interp, &_jsi_STACKIDX(interp->framePtr->Sp), (uintptr_t)ip->data);
jsiPush(interp,1);
break;
case OP_PUSHNUM:
Jsi_ValueMakeNumber(interp, &_jsi_STACKIDX(interp->framePtr->Sp), (*((Jsi_Number *)ip->data)));
jsiPush(interp,1);
break;
case OP_PUSHSTR: {
Jsi_Value **v = &_jsi_STACKIDX(interp->framePtr->Sp);
Jsi_ValueMakeStringKey(interp, v, (char*)ip->data);
interp->lastPushStr = Jsi_ValueString(interp, *v, NULL);
jsiPush(interp,1);
break;
}
case OP_PUSHVSTR: {
Jsi_String *s = (Jsi_String *)ip->data;
Jsi_Value **v = &_jsi_STACKIDX(interp->framePtr->Sp);
if (s->flags&1)
jsi_ValueMakeBlobDup(interp,v, (uchar*)s->str, s->len);
else {
Jsi_ValueMakeStringKey(interp, v, s->str);
interp->lastPushStr = s->str;
}
jsiPush(interp,1);
break;
}
case OP_PUSHVAR: {
rc = jsi_PushVar(ps, ip, scope, currentScope, context_id);
break;
}
case OP_PUSHFUN: {
jsi_PushFunc(ps, ip, scope, currentScope);
break;
}
case OP_NEWFCALL:
if (interp->maxUserObjs && interp->userObjCnt > interp->maxUserObjs) {
rc = Jsi_LogError("Max 'new' count exceeded");
break;
}
case OP_FCALL: {
/* TODO: need reliable way to capture func string name to handle unknown functions.*/
int discard = ((ip+1)<end && ip[1].op == OP_POP);
switch (jsiEvalFunction(ps, ip, discard)) { /* throw an execption */
case JSI_OK: break;
case JSI_BREAK:
if (interp->framePtr->tryDepth<=0)
interp->isHelp = 1;
JSI_DO_THROW("help");
break;
default:
JSI_DO_THROW("fcall");
}
strict = interp->strict;
/* TODO: new Function return a function without scopechain, add here */
break;
}
case OP_SUBSCRIPT: {
rc = jsi_evalSubscript(interp, _jsi_TOQ, _jsi_TOP, ip, end, currentScope);
break;
}
case OP_ASSIGN: {
Jsi_Value *sval = _jsi_TOP, *dval = _jsi_TOQ;
bool globThis = (sval->vt == JSI_VT_OBJECT && sval->d.obj == interp->csc->d.obj);
if ((uintptr_t)ip->data == 1) {
jsiVarDeref(interp,1);
rc = jsi_ValueAssign(interp, dval, sval, lop);
if (strict && sval->vt == JSI_VT_UNDEF)
rc = jsi_ValueAssignCheck(interp, sval, lop);
jsiPop(interp,1);
} else {
jsiVarDeref(interp, 3);
Jsi_Value *v3 = _jsi_STACKIDX(interp->framePtr->Sp-3);
if (v3->vt == JSI_VT_OBJECT) {
if (strict && sval->vt == JSI_VT_UNDEF)
rc = jsi_ValueAssignCheck(interp, sval, lop);
jsi_ValueObjKeyAssign(interp, v3, dval, sval, 0);
jsi_ValueDebugLabel(sval, "assign", NULL);
} else if (strict)
rc = Jsi_LogError("assign to a non-exist object");
jsiClearStack(interp,3);
Jsi_ValueCopy(interp,v3, sval);
dval = v3;
jsiPop(interp, 2);
}
if (interp->framePtr->level<=1 && globThis && rc == JSI_OK && dval && dval->vt == JSI_VT_VARIABLE) {
dval = dval->d.lval;
//printf("GLOBAL THIS: %p\n", dval);
Jsi_HashSet(interp->genValueTbl, dval, dval);
}
break;
}
case OP_PUSHREG: {
Jsi_Obj *obj = Jsi_ObjNewType(interp, JSI_OT_REGEXP);
obj->d.robj = (Jsi_Regex *)ip->data;
Jsi_ValueMakeObject(interp, &_jsi_STACKIDX(interp->framePtr->Sp), obj);
jsiPush(interp,1);
break;
}
case OP_PUSHARG:
//Jsi_ValueCopy(interp,_jsi_STACKIDX(interp->framePtr->Sp), currentScope);
if (!interp->framePtr->arguments) {
interp->framePtr->arguments = Jsi_ValueNewObj(interp,
Jsi_ObjNewArray(interp, currentScope->d.obj->arr, currentScope->d.obj->arrCnt, 0));
Jsi_IncrRefCount(interp, interp->framePtr->arguments);
if (interp->hasCallee) {
Jsi_Value *callee = Jsi_ValueObjLookup(interp, currentScope, "\1callee\1", 0);
if (callee)
Jsi_ValueInsert(interp, interp->framePtr->arguments, "\1callee\1", callee, JSI_OM_DONTENUM);
}
// interp->framePtr->arguments->d.obj->__proto__ = interp->Object_prototype; // ecma
}
Jsi_ValueCopy(interp,_jsi_STACKIDX(interp->framePtr->Sp), interp->framePtr->arguments);
jsiPush(interp,1);
break;
case OP_PUSHTHS: { //TODO: Value copy can cause memory leak!
Jsi_Value *tval = _jsi_STACKIDX(interp->framePtr->Sp);
Jsi_ValueCopy(interp, tval, _this);
/*if (interp->csc == _this)
Jsi_ValueDup2(interp, &tval, _this);
else
Jsi_ValueCopy(interp, tval, _this);*/
jsiPush(interp,1);
break;
}
case OP_PUSHTOP:
Jsi_ValueCopy(interp,_jsi_STACKIDX(interp->framePtr->Sp), _jsi_TOP);
jsiPush(interp,1);
break;
case OP_UNREF:
jsiVarDeref(interp,1);
break;
case OP_PUSHTOP2: {
Jsi_Value *vp1 = _jsi_STACKIDX(interp->framePtr->Sp);
Jsi_Value *vp2 = _jsi_STACKIDX(interp->framePtr->Sp+1);
if (!vp1 || !vp2)
rc = Jsi_LogError("Invalid lookup/push");
else {
Jsi_ValueCopy(interp, vp1, _jsi_TOQ);
Jsi_ValueCopy(interp, vp2, _jsi_TOP);
jsiPush(interp, 2);
}
break;
}
case OP_CHTHIS: {
if (ip->data) {
int t = interp->framePtr->Sp - 2;
Assert(t>=0);
Jsi_Value *v = _jsi_THISIDX(t);
jsiClearThis(interp, t);
Jsi_ValueCopy(interp, v, _jsi_TOQ);
if (v->vt == JSI_VT_VARIABLE) {
Jsi_ValueCopy(interp, v, v->d.lval);
}
Jsi_ValueToObject(interp, v);
}
break;
}
case OP_LOCAL: {
Jsi_Value key = VALINIT, *kPtr = &key; // Note we use a string key so no reset needed.
Jsi_ValueMakeStringKey(interp, &kPtr, (char*)ip->data);
jsi_ValueObjKeyAssign(interp, currentScope, kPtr, NULL, JSI_OM_DONTENUM);
context_id = ps->_context_id++;
break;
}
case OP_POP: {
Jsi_Value *tval = _jsi_TOP;
if ((interp->evalFlags&JSI_EVAL_RETURN) && (ip+1) >= end &&
(Jsi_ValueIsObjType(interp, tval, JSI_OT_ITER)==0 &&
Jsi_ValueIsObjType(interp, tval, JSI_OT_FUNCTION)==0)) {
/* Interactive and last instruction is a pop: save result. */
Jsi_ValueMove(interp, vret, tval); /*TODO***: correct ***/
tval->vt = JSI_VT_UNDEF;
}
jsiPop(interp, (uintptr_t)ip->data);
break;
}
case OP_NEG:
jsiVarDeref(interp,1);
Jsi_ValueToNumber(interp, _jsi_TOP);
rc = _jsi_StrictChk(_jsi_TOP);
_jsi_TOP->d.num = -(_jsi_TOP->d.num);
break;
case OP_POS:
jsiVarDeref(interp,1);
Jsi_ValueToNumber(interp, _jsi_TOP);
rc = _jsi_StrictChk(_jsi_TOP);
break;
case OP_NOT: {
int val = 0;
jsiVarDeref(interp,1);
val = Jsi_ValueIsTrue(interp, _jsi_TOP);
jsiClearStack(interp,1);
Jsi_ValueMakeBool(interp, &_jsi_TOP, !val);
break;
}
case OP_BNOT: {
jsiVarDeref(interp,1);
jsi_ValueToOInt32(interp, _jsi_TOP);
rc = _jsi_StrictChk(_jsi_TOP);
_jsi_TOP->d.num = (Jsi_Number)(~((int)_jsi_TOP->d.num));
break;
}
case OP_ADD: {
jsiVarDeref(interp,2);
Jsi_Value *v, *v1 = _jsi_TOP, *v2 = _jsi_TOQ;
int l1, l2;
if (strict)
if (Jsi_ValueIsUndef(interp, v1) || Jsi_ValueIsUndef(interp, v2)) {
rc = Jsi_LogError("operand value to + is undefined");
break;
}
char *s1 = Jsi_ValueString(interp, v1, &l1);
char *s2 = Jsi_ValueString(interp, v2, &l2);
if (s1 || s2) {
char *str;
if (!(s1 && s2)) {
v = (s1 ? v2 : v1);
jsi_ValueToPrimitive(interp, &v);
Jsi_ValueToString(interp, v, NULL);
str = Jsi_ValueString(interp, v, (s1?&l2:&l1));
if (s1) s2 = str; else s1 = str;
}
Assert(l1>=0 && l1<=JSI_MAX_ALLOC_BUF);
Assert(l2>=0 && l2<=JSI_MAX_ALLOC_BUF);
str = (char*)Jsi_Malloc(l1+l2+1);
memcpy(str, s2, l2);
memcpy(str+l2, s1, l1);
str[l1+l2] = 0;
jsiClearStack(interp,2);
Jsi_ValueMakeBlob(interp, &v2, (uchar*)str, l1+l2);
} else {
Jsi_ValueToNumber(interp, v1);
Jsi_ValueToNumber(interp, v2);
rc = _jsi_StrictChk2(v1, v2);
Jsi_Number n = v1->d.num + v2->d.num;
jsiClearStack(interp,2);
Jsi_ValueMakeNumber(interp, &v2, n);
}
jsiPop(interp,1);
break;
}
case OP_IN: {
Jsi_Value *v, *vl;
const char *cp = NULL;
Jsi_Number nval;
jsiVarDeref(interp,2);
vl = _jsi_TOQ;
v = _jsi_TOP;
if (Jsi_ValueIsString(interp,vl))
cp = Jsi_ValueGetStringLen(interp, vl, NULL);
else if (Jsi_ValueIsNumber(interp,vl))
Jsi_ValueGetNumber(interp, vl, &nval);
else {
if (strict)
Jsi_LogWarn("expected string or number before IN");
Jsi_ValueMakeBool(interp, &_jsi_TOQ, 0);
jsiPop(interp,1);
break;
}
if (v->vt == JSI_VT_VARIABLE) {
v = v->d.lval;
SIGASSERT(v, VALUE);
}
if (v->vt != JSI_VT_OBJECT || v->d.obj->ot != JSI_OT_OBJECT) {
if (strict)
Jsi_LogWarn("expected object after IN");
Jsi_ValueMakeBool(interp, &_jsi_TOQ, 0);
jsiPop(interp,1);
break;
}
int bval = 0;
char nbuf[JSI_MAX_NUMBER_STRING];
Jsi_Value *vv;
Jsi_Obj *obj = v->d.obj;
if (!cp) {
snprintf(nbuf, sizeof(nbuf), "%d", (int)nval);
cp = nbuf;
}
if (obj->arr) {
vv = jsi_ObjArrayLookup(interp, obj, (char*)cp);
} else {
vv = Jsi_TreeObjGetValue(obj, (char*)cp, 1);
}
bval = (vv != 0);
Jsi_ValueMakeBool(interp, &_jsi_TOQ, bval);
jsiPop(interp,1);
break;
}
case OP_SUB:
common_math_opr(-); break;
case OP_MUL:
common_math_opr(*); break;
case OP_DIV:
common_math_opr(/); break;
case OP_MOD: {
jsiVarDeref(interp,2);
if (!Jsi_ValueIsType(interp,_jsi_TOP, JSI_VT_NUMBER))
Jsi_ValueToNumber(interp, _jsi_TOP);
if (!Jsi_ValueIsType(interp,_jsi_TOQ, JSI_VT_NUMBER))
Jsi_ValueToNumber(interp, _jsi_TOQ);
rc = _jsi_StrictChk2(_jsi_TOP,_jsi_TOQ);
if (rc == JSI_OK)
_jsi_TOQ->d.num = fmod(_jsi_TOQ->d.num, _jsi_TOP->d.num);
jsiPop(interp,1);
break;
}
case OP_LESS:
jsiVarDeref(interp,2);
rc = jsi_logic_less(interp,2,1);
jsiPop(interp,1);
break;
case OP_GREATER:
jsiVarDeref(interp,2);
rc = jsi_logic_less(interp,1,2);
jsiPop(interp,1);
break;
case OP_LESSEQU:
jsiVarDeref(interp,2);
rc = jsi_logic_less(interp,1,2);
if (rc == JSI_OK)
_jsi_TOQ->d.val = !_jsi_TOQ->d.val;
jsiPop(interp,1);
break;
case OP_GREATEREQU:
jsiVarDeref(interp,2);
rc = jsi_logic_less(interp,2,1);
if (rc == JSI_OK)
_jsi_TOQ->d.val = !_jsi_TOQ->d.val;
jsiPop(interp,1);
break;
case OP_EQUAL:
case OP_NOTEQUAL: {
jsiVarDeref(interp,2);
int r = Jsi_ValueCmp(interp, _jsi_TOP, _jsi_TOQ, 0);
r = (ip->op == OP_EQUAL ? !r : r);
jsiClearStack(interp,2);
Jsi_ValueMakeBool(interp, &_jsi_TOQ, r);
jsiPop(interp,1);
break;
}
case OP_STRICTEQU:
case OP_STRICTNEQ: {
int r = 0;
jsiVarDeref(interp,2);
rc = _jsi_StrictUChk3(_jsi_TOQ, _jsi_TOP);
r = !Jsi_ValueIsEqual(interp, _jsi_TOP, _jsi_TOQ);
r = (ip->op == OP_STRICTEQU ? !r : r);
jsiClearStack(interp,2);
Jsi_ValueMakeBool(interp, &_jsi_TOQ, r);
jsiPop(interp,1);
break;
}
case OP_BAND:
common_bitwise_opr(&); break;
case OP_BOR:
common_bitwise_opr(|); break;
case OP_BXOR:
common_bitwise_opr(^); break;
case OP_SHF: {
jsiVarDeref(interp,2);
jsi_ValueToOInt32(interp, _jsi_TOQ);
jsi_ValueToOInt32(interp, _jsi_TOP);
int t1 = (int)_jsi_TOQ->d.num;
int t2 = ((unsigned int)_jsi_TOP->d.num) & 0x1f;
if (ip->data) { /* shift right */
if ((uintptr_t)ip->data == 2) { /* unsigned shift */
unsigned int t3 = (unsigned int)t1;
t3 >>= t2;
Jsi_ValueMakeNumber(interp, &_jsi_TOQ, t3);
} else {
t1 >>= t2;
Jsi_ValueMakeNumber(interp, &_jsi_TOQ, t1);
}
} else {
t1 <<= t2;
Jsi_ValueMakeNumber(interp, &_jsi_TOQ, t1);
}
jsiPop(interp,1);
break;
}
case OP_KEY: {
jsiVarDeref(interp,1);
if (ip->isof && !Jsi_ValueIsArray(interp, _jsi_TOP)) {
rc = Jsi_LogError("operand not an array");
break;
}
if (_jsi_TOP->vt != JSI_VT_UNDEF && _jsi_TOP->vt != JSI_VT_NULL)
Jsi_ValueToObject(interp, _jsi_TOP);
Jsi_Value *spret = Jsi_ValueNew1(interp);
jsi_ValueObjGetKeys(interp, _jsi_TOP, spret, ip->isof);
Jsi_ValueReplace(interp, _jsi_STACK+interp->framePtr->Sp, spret);
Jsi_DecrRefCount(interp, spret);
jsiPush(interp,1);
break;
}
case OP_NEXT: {
Jsi_Value *toq = _jsi_TOQ, *top = _jsi_TOP;
if (toq->vt != JSI_VT_OBJECT || toq->d.obj->ot != JSI_OT_ITER) Jsi_LogBug("next: toq not a iter\n");
if (top->vt != JSI_VT_VARIABLE) {
rc = Jsi_LogError ("invalid for/in left hand-side");
break;
}
if (strict && top->f.bits.local==0) {
const char *varname = "";
Jsi_Value *v = top->d.lval;
if (v->f.bits.lookupfailed)
varname = v->d.lookupFail;
rc = Jsi_LogError("function created global: \"%s\"", varname);
break;
}
Jsi_IterObj *io = toq->d.obj->d.iobj;
if (io->iterCmd) {
io->iterCmd(io, top, _jsi_STACKIDX(interp->framePtr->Sp-3), io->iter++);
} else {
while (io->iter < io->count) {
if (!io->isArrayList) {
if (Jsi_ValueKeyPresent(interp, _jsi_STACKIDX(interp->framePtr->Sp-3), io->keys[io->iter],1))
break;
} else {
while (io->cur < io->obj->arrCnt) {
if (io->obj->arr[io->cur]) break;
io->cur++;
}
if (io->cur >= io->obj->arrCnt) {
/* TODO: Is this really a bug??? */
/* Jsi_LogBug("NOT FOUND LIST ARRAY");*/
io->iter = io->count;
break;
} else if (io->obj->arr[io->cur]) {
io->cur++;
break;
}
}
io->iter++;
}
if (io->iter >= io->count) {
jsiClearStack(interp,1);
Jsi_ValueMakeNumber(interp, &_jsi_TOP, 0);
} else {
Jsi_Value **vPtr = &_jsi_TOP->d.lval, *v = *vPtr;
SIGASSERT(v, VALUE);
Jsi_ValueReset(interp, vPtr);
if (io->isArrayList) {
if (!io->isof)
Jsi_ValueMakeNumber(interp, &v, io->cur-1);
else if (!io->obj->arr[io->cur-1])
Jsi_ValueMakeNull(interp, &v);
else
Jsi_ValueCopy(interp, v, io->obj->arr[io->cur-1]);
} else
Jsi_ValueMakeStringKey(interp, &v, io->keys[io->iter]);
io->iter++;
jsiClearStack(interp,1);
Jsi_ValueMakeNumber(interp, &_jsi_TOP, 1);
}
break;
}
}
case OP_INC:
case OP_DEC: {
int inc = ip->op == OP_INC ? 1 : -1;
if (_jsi_TOP->vt != JSI_VT_VARIABLE) {
rc = Jsi_LogError("operand not left value");
break;
}
Jsi_Value *v = _jsi_TOP->d.lval;
SIGASSERT(v, VALUE);
Jsi_ValueToNumber(interp, v);
rc = _jsi_StrictChk(v);
v->d.num += inc;
jsiVarDeref(interp,1);
if (ip->data) {
_jsi_TOP->d.num -= inc;
}
break;
}
case OP_TYPEOF: {
const char *typ;
Jsi_Value *v = _jsi_TOP;
if (v->vt == JSI_VT_VARIABLE) {
v = v->d.lval;
SIGASSERT(v, VALUE);
}
typ = Jsi_ValueTypeStr(interp, v);
jsiVarDeref(interp,1);
Jsi_ValueMakeStringKey(interp, &_jsi_TOP, (char*)typ);
break;
}
case OP_INSTANCEOF: {
jsiVarDeref(interp,2);
int bval = Jsi_ValueInstanceOf(interp, _jsi_TOQ, _jsi_TOP);
jsiPop(interp,1);
Jsi_ValueMakeBool(interp, &_jsi_TOP, bval);
break;
}
case OP_JTRUE:
case OP_JFALSE:
case OP_JTRUE_NP:
case OP_JFALSE_NP: {
jsiVarDeref(interp,1);
int off = (uintptr_t)ip->data - 1;
int r = Jsi_ValueIsTrue(interp, _jsi_TOP);
if (ip->op == OP_JTRUE || ip->op == OP_JFALSE) jsiPop(interp,1);
ip += ((ip->op == OP_JTRUE || ip->op == OP_JTRUE_NP) ^ r) ? 0 : off;
break;
}
case OP_JMPPOP:
jsiPop(interp, ((jsi_JmpPopInfo *)ip->data)->topop);
case OP_JMP: {
int off = (ip->op == OP_JMP ? (uintptr_t)ip->data - 1
: (uintptr_t)((jsi_JmpPopInfo *)ip->data)->off - 1);
while (1) {
if (trylist == NULL) break;
jsi_OpCode *tojmp = ip + off;
/* jmp out of a try block, should execute the finally block */
/* while jmp out a 'with' block, restore the scope */
if (trylist->type == jsi_TL_TRY) {
if (tojmp >= trylist->d.td.tstart && tojmp < trylist->d.td.fend) break;
if (ip >= trylist->d.td.tstart && ip < trylist->d.td.cend) {
trylist->d.td.last_op = jsi_LOP_JMP;
trylist->d.td.ld.tojmp = tojmp;
ip = trylist->d.td.fstart - 1;
off = 0;
break;
} else if (ip >= trylist->d.td.fstart && ip < trylist->d.td.fend) {
pop_try(trylist);
} else Jsi_LogBug("jmp within a try, but not in its scope?");
} else {
/* with block */
if (tojmp >= trylist->d.wd.wstart && tojmp < trylist->d.wd.wend) break;
JSI_RESTORE_SCOPE();
pop_try(trylist);
}
}
ip += off;
break;
}
case OP_EVAL: {
int stackargc = (uintptr_t)ip->data;
jsiVarDeref(interp, stackargc);
int r = 0;
Jsi_Value *spPtr = Jsi_ValueNew1(interp);
if (stackargc > 0) {
if (_jsi_STACKIDX(interp->framePtr->Sp - stackargc)->vt == JSI_VT_UNDEF) {
Jsi_LogError("undefined value to eval()");
goto undef_eval;
}
int plen;
char *pro = Jsi_ValueString(interp, _jsi_STACKIDX(interp->framePtr->Sp - stackargc), &plen);
if (pro) {
pro = Jsi_StrdupLen(pro, plen);
r = jsiEvalOp(interp, ps, pro, scope, currentScope, _this, &spPtr);
Jsi_Free(pro);
} else {
Jsi_ValueCopy(interp, spPtr, _jsi_STACKIDX(interp->framePtr->Sp - stackargc));
}
}
undef_eval:
jsiPop(interp, stackargc);
Jsi_ValueCopy(interp, _jsi_STACK[interp->framePtr->Sp], spPtr); /*TODO: is this correct?*/
Jsi_DecrRefCount(interp, spPtr);
jsiPush(interp,1);
if (r) {
JSI_DO_THROW("eval");
}
break;
}
case OP_RET: {
if (interp->framePtr->Sp>=1 && ip->data) {
jsiVarDeref(interp,1);
Jsi_ValueMove(interp, vret, _jsi_TOP);
}
jsiPop(interp, (uintptr_t)ip->data);
interp->didReturn = 1;
if (trylist) {
while (trylist) {
if (trylist->type == jsi_TL_TRY && trylist->inCatch)
JSI_RESTORE_SCOPE();
pop_try(trylist);
}
goto done;
}
ip = end;
break;
}
case OP_DELETE: {
int count = (uintptr_t)ip->data;
if (count == 1) { // Non-standard.
if (_jsi_TOP->vt != JSI_VT_VARIABLE)
rc = Jsi_LogError("delete a right value");
else {
Jsi_Value **vPtr = &_jsi_TOP->d.lval, *v = *vPtr;
SIGASSERT(v, VALUE);
if (v->f.bits.dontdel) {
if (strict) rc = Jsi_LogWarn("delete not allowed");
} else if (v != currentScope) {
Jsi_ValueReset(interp,vPtr); /* not allow to delete arguments */
}
else if (strict)
Jsi_LogWarn("Delete arguments");
}
jsiPop(interp,1);
} else if (count == 2) {
jsiVarDeref(interp,2);
assert(interp->framePtr->Sp>=2);
if (strict) {
if (_jsi_TOQ->vt != JSI_VT_OBJECT) Jsi_LogWarn("delete non-object key, ignore");
if (_jsi_TOQ->d.obj == currentScope->d.obj) Jsi_LogWarn("Delete arguments");
}
jsi_ValueObjDelete(interp, _jsi_TOQ, _jsi_TOP, 0);
jsiPop(interp,2);
} else Jsi_LogBug("delete");
break;
}
case OP_OBJECT: {
int itemcount = (uintptr_t)ip->data;
Assert(itemcount>=0);
jsiVarDeref(interp, itemcount * 2);
Jsi_Obj *obj = Jsi_ObjNewObj(interp, _jsi_STACK+(interp->framePtr->Sp-itemcount*2), itemcount*2);
jsiPop(interp, itemcount * 2 - 1); /* one left */
jsiClearStack(interp,1);
Jsi_ValueMakeObject(interp, &_jsi_TOP, obj);
break;
}
case OP_ARRAY: {
int itemcount = (uintptr_t)ip->data;
Assert(itemcount>=0);
jsiVarDeref(interp, itemcount);
Jsi_Obj *obj = Jsi_ObjNewArray(interp, _jsi_STACK+(interp->framePtr->Sp-itemcount), itemcount, 1);
jsiPop(interp, itemcount - 1);
jsiClearStack(interp,1);
Jsi_ValueMakeObject(interp, &_jsi_TOP, obj);
break;
}
case OP_STRY: {
jsi_TryInfo *ti = (jsi_TryInfo *)ip->data;
jsi_TryList *n = jsi_trylist_new(jsi_TL_TRY, scope, currentScope);
n->d.td.tstart = ip; /* make every thing pointed to right pos */
n->d.td.tend = n->d.td.tstart + ti->trylen;
n->d.td.cstart = n->d.td.tend + 1;
n->d.td.cend = n->d.td.tend + ti->catchlen;
n->d.td.fstart = n->d.td.cend + 1;
n->d.td.fend = n->d.td.cend + ti->finallen;
n->d.td.tsp = interp->framePtr->Sp;
n->inCatch=0;
n->inFinal=0;
jsi_push_try(interp, &trylist, n);
break;
}
case OP_ETRY: { /* means nothing happen go to final */
if (trylist == NULL || trylist->type != jsi_TL_TRY)
Jsi_LogBug("Unexpected ETRY opcode??");
ip = trylist->d.td.fstart - 1;
break;
}
case OP_SCATCH: {
if (trylist == NULL || trylist->type != jsi_TL_TRY)
Jsi_LogBug("Unexpected SCATCH opcode??");
if (!ip->data) {
JSI_DO_THROW("catch");
} else {
trylist->inCatch=1;
/* new scope and make var */
scope = jsi_ScopeChainDupNext(interp, scope, currentScope);
currentScope = jsi_ObjValueNew(interp);
interp->framePtr->ingsc = scope; //TODO: changing frame
interp->framePtr->incsc = currentScope;
Jsi_IncrRefCount(interp, currentScope);
Jsi_Value *excpt = Jsi_ValueNew1(interp);
if (ps->last_exception && ps->last_exception->vt != JSI_VT_UNDEF) {
//TODO: fix test262 crash in freeValueTbl@jsiInterp.c:565 for last_exception which is
// freed in jsi_PstateFree@jsiPstate.c:251. Is this code the problem?
Jsi_Value *ple = ps->last_exception;
Jsi_ValueCopy(interp, excpt, ple);
Jsi_ValueReset(interp, &ps->last_exception);
} else if (interp->errMsgBuf[0]) {
Jsi_ValueMakeStringDup(interp, &excpt, interp->errMsgBuf);
interp->errMsgBuf[0] = 0;
}
Jsi_ValueInsert(interp, currentScope, (char*)ip->data, excpt, JSI_OM_DONTENUM);
Jsi_DecrRefCount(interp, excpt);
context_id = ps->_context_id++;
}
break;
}
case OP_ECATCH: {
if (trylist == NULL || trylist->type != jsi_TL_TRY)
Jsi_LogBug("Unexpected ECATCH opcode??");
trylist->inCatch=0;
ip = trylist->d.td.fstart - 1;
break;
}
case OP_SFINAL: {
if (trylist == NULL || trylist->type != jsi_TL_TRY)
Jsi_LogBug("Unexpected SFINAL opcode??");
/* restore scatch scope chain */
trylist->inFinal = 1;
JSI_RESTORE_SCOPE();
break;
}
case OP_EFINAL: {
if (trylist == NULL || trylist->type != jsi_TL_TRY)
Jsi_LogBug("Unexpected EFINAL opcode??");
trylist->inFinal = 0;
int last_op = trylist->d.td.last_op;
jsi_OpCode *tojmp = (last_op == jsi_LOP_JMP ? trylist->d.td.ld.tojmp : 0);
pop_try(trylist);
if (last_op == jsi_LOP_THROW) {
JSI_DO_THROW("finally");
} else if (last_op == jsi_LOP_JMP) {
while (1) {
if (trylist == NULL) {
ip = tojmp;
break;
}
/* same as jmp opcode, see above */
if (trylist->type == jsi_TL_TRY) {
if (tojmp >= trylist->d.td.tstart && tojmp < trylist->d.td.fend) {
ip = tojmp;
break;
}
if (ip >= trylist->d.td.tstart && ip < trylist->d.td.cend) {
trylist->d.td.last_op = jsi_LOP_JMP;
trylist->d.td.ld.tojmp = tojmp;
ip = trylist->d.td.fstart - 1;
break;
} else if (ip >= trylist->d.td.fstart && ip < trylist->d.td.fend) {
pop_try(trylist);
} else Jsi_LogBug("jmp within a try, but not in its scope?");
} else { /* 'with' block */
if (tojmp >= trylist->d.wd.wstart && tojmp < trylist->d.wd.wend) {
ip = tojmp;
break;
}
JSI_RESTORE_SCOPE();
pop_try(trylist);
}
}
}
break;
}
case OP_THROW: {
jsiVarDeref(interp,1);
Jsi_ValueDup2(interp,&ps->last_exception, _jsi_TOP);
interp->didReturn = 1; /* TODO: could possibly hide _jsi_STACK problem */
JSI_DO_THROW("throw");
break;
}
case OP_WITH: {
static int warnwith = 1;
if (strict && warnwith && interp->typeCheck.nowith) {
warnwith = 0;
rc = Jsi_LogError("use of with is illegal due to \"use nowith\"");
break;
}
jsiVarDeref(interp,1);
Jsi_ValueToObject(interp, _jsi_TOP);
jsi_TryList *n = jsi_trylist_new(jsi_TL_WITH, scope, currentScope);
n->d.wd.wstart = ip;
n->d.wd.wend = n->d.wd.wstart + (uintptr_t)ip->data;
jsi_push_try(interp, &trylist, n);
interp->framePtr->withDepth++;
/* make expr to top of scope chain */
scope = jsi_ScopeChainDupNext(interp, scope, currentScope);
currentScope = Jsi_ValueNew1(interp);
interp->framePtr->ingsc = scope;
interp->framePtr->incsc = currentScope;
Jsi_ValueCopy(interp, currentScope, _jsi_TOP);
jsiPop(interp,1);
context_id = ps->_context_id++;
break;
}
case OP_EWITH: {
if (trylist == NULL || trylist->type != jsi_TL_WITH)
Jsi_LogBug("Unexpected EWITH opcode??");
JSI_RESTORE_SCOPE();
pop_try(trylist);
interp->framePtr->withDepth--;
break;
}
case OP_DEBUG: {
jsi_DebuggerStmt();
jsiPush(interp,1);
break;
}
case OP_RESERVED: {
jsi_ReservedInfo *ri = (jsi_ReservedInfo *)ip->data;
const char *cmd = ri->type == RES_CONTINUE ? "continue" : "break";
/* TODO: continue/break out of labeled scope: see tests/prob/break.jsi. */
if (ri->label) {
Jsi_LogError("%s: label(%s) not found", cmd, ri->label);
} else {
Jsi_LogError("%s must be inside loop(or switch)", cmd);
}
rc = JSI_ERROR;
break;
}
#ifndef __cplusplus
default:
Jsi_LogBug("invalid op ceod: %d", ip->op);
#endif
}
lop = plop;
ip++;
}
done:
while (trylist) {
JSI_RESTORE_SCOPE();
pop_try(trylist);
}
return rc;
} | 135,294,549,024,509,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,635 | 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 SwapNodes(Jsi_TreeEntry* n, Jsi_TreeEntry* m)
{
Jsi_Tree* t = n->treePtr;
Jsi_TreeEntry *np, *nl, *nr, *mp, *ml, *mr;
int mpc = 0, npc = 0, col = n->f.bits.color;
n->f.bits.color = m->f.bits.color; m->f.bits.color = col;
np = n->parent; nl = n->left; nr = n->right;
mp = m->parent; ml = m->left; mr = m->right;
if (mp) mpc = (mp->left == m ?1 : 2);
if (np) npc = (np->left == n ?1 : 2);
n->parent = mp; n->left = ml; n->right = mr;
m->parent = np; m->left = nl; m->right = nr;
if (np == m) {
m->parent = n;
if (mr == n) n->right = m; else n->left = m;
} else if (mp == n) {
n->parent = m;
if (nr == m) m->right = n; else m->left = n;
}
/* Fixup back pointers. */
if (m->left) m->left->parent = m;
if (m->right) m->right->parent = m;
if (n->left) n->left->parent = n;
if (n->right) n->right->parent = n;
if (mpc) { if (mpc==1) n->parent->left = n; else n->parent->right = n;}
if (npc) { if (npc==1) m->parent->left = m; else m->parent->right = m; }
if (n->parent == NULL) {
t->root = n;
} else if (m->parent == NULL) {
t->root = m;
}
} | 188,106,770,727,228,360,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,636 | 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_HashEntryFind( Jsi_Hash *tablePtr, const void *key)
{
if (tablePtr->opts.lockHashProc && (*tablePtr->opts.lockHashProc)(tablePtr, 1) != JSI_OK)
return NULL;
Jsi_HashEntry *hPtr = (*((tablePtr)->findProc))(tablePtr, key);
if (tablePtr->opts.lockHashProc)
(*tablePtr->opts.lockHashProc)(tablePtr, 0);
return hPtr;
} | 153,710,964,699,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,637 | 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_num(Jsi_Number *v) { JSI_NEW_CODES(1,OP_PUSHNUM, v); } | 52,478,233,209,677,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,638 | 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_ValueNewBlob(Jsi_Interp *interp, unsigned char *s, uint len) {
Jsi_Value *v = Jsi_ValueNew(interp);
Jsi_Obj *o = Jsi_ObjNewType(interp, JSI_OT_STRING);
Jsi_ValueMakeObject(interp, &v, o);
o->d.s.str = (char*)Jsi_Malloc(len+1);
memcpy(o->d.s.str, (char*)s, len);
o->d.s.str[len] = 0;
o->d.s.len = len;
o->isBlob = 1;
return v;
} | 239,294,335,502,054,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,639 | 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_NumberIsNaN(Jsi_Number n)
{
return isnan(n);
} | 337,857,641,252,596,230,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,640 | 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 OneWordCompare(Jsi_Tree *treePtr, const void *key1, const void *key2)
{
return ((uintptr_t )key1 - (uintptr_t)key2);
} | 68,162,433,045,652,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,641 | 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_ValueGetNumber(Jsi_Interp *interp, Jsi_Value *pv, Jsi_Number *val)
{
if (!pv) return JSI_ERROR;
if (pv->vt == JSI_VT_NUMBER)
*val = pv->d.num;
else if (pv->vt == JSI_VT_OBJECT && pv->d.obj->ot == JSI_OT_NUMBER)
*val = pv->d.obj->d.num;
else
return JSI_ERROR;
return JSI_OK;
} | 216,593,504,863,230,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,642 | 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_GlobMatch(const char *pattern, const char *string, int nocase)
{
int c;
int pchar;
while (*pattern) {
switch (pattern[0]) {
case '*':
while (pattern[1] == '*') {
pattern++;
}
pattern++;
if (!pattern[0]) {
return 1; /* match */
}
while (*string) {
if (Jsi_GlobMatch(pattern, string, nocase))
return 1; /* match */
string += Jsi_UtfToUniChar(string, &c);
}
return 0; /* no match */
case '?':
string += Jsi_UtfToUniChar(string, &c);
break;
case '[': {
string += Jsi_UtfToUniChar(string, &c);
pattern = JsiCharsetMatch(pattern + 1, c, nocase ? JSI_CMP_NOCASE : 0);
if (!pattern) {
return 0;
}
if (!*pattern) {
/* Ran out of pattern (no ']') */
continue;
}
break;
}
case '\\':
if (pattern[1]) {
pattern++;
}
/* fall through */
default:
string += Jsi_UtfToUniCharCase(string, &c, nocase);
Jsi_UtfToUniCharCase(pattern, &pchar, nocase);
if (pchar != c) {
return 0;
}
break;
}
pattern += Jsi_UtfToUniCharCase(pattern, &pchar, nocase);
if (!*string) {
while (*pattern == '*') {
pattern++;
}
break;
}
}
if (!*pattern && !*string) {
return 1;
}
return 0;
} | 127,739,822,951,474,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,643 | 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 const char **jsi_OptGetEnumList(Jsi_OptionSpec* spec) {
const char **list = (const char**)spec->data;
Jsi_OptionSpec* es=NULL;
int fflags = (spec->flags);
if (spec->id != JSI_OPTION_CUSTOM || spec->custom != Jsi_Opt_SwitchEnum)
return list;
if (list && (fflags & JSI_OPT_ENUM_SPEC)) {
es = (typeof(es))list;
while (es->id != JSI_OPTION_END)
es++;
list = es->init.STRKEY;
}
return list;
} | 324,129,574,543,880,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,644 | 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_ValueObjGetKeys(Jsi_Interp *interp, Jsi_Value *target, Jsi_Value *ret, bool isof)
{
Jsi_IterObj *io = Jsi_IterObjNew(interp, NULL);
Jsi_Obj *to = target->d.obj;
if (target->vt != JSI_VT_UNDEF && target->vt != JSI_VT_NULL) {
if (target->vt == JSI_VT_OBJECT && to->arr) {
io->isArrayList = 1;
io->count = to->arrCnt;
} else {
if (isof &&interp->strict)
Jsi_LogWarn("non-array in 'for...of'");
Jsi_IterGetKeys(interp, target, io, 0);
}
}
io->obj = to;
io->isof = isof;
Jsi_Obj *r = Jsi_ObjNew(interp);
r->ot = JSI_OT_ITER;
r->d.iobj = io;
Jsi_ValueMakeObject(interp, &ret, r);
} | 34,292,700,636,760,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,645 | 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_OptionsDump(Jsi_Interp *interp, Jsi_OptionSpec *specs, void *rec, Jsi_Value **ret, Jsi_Wide flags)
{
char *record = (char*)rec;
Jsi_OptionSpec *specPtr = specs;
int len = 0, i = 0, count = 0;
if (!Jsi_OptionsValid(interp, specs))
return Jsi_LogError("invalid options");
while (specPtr->id>=JSI_OPTION_BOOL && specPtr->id < JSI_OPTION_END && specPtr->name) {
specPtr++;
len+=2;
}
if (!len)
return JSI_OK;
Jsi_Value *rv = Jsi_ValueMakeObject(interp, NULL, NULL);
Jsi_IncrRefCount(interp, rv);
Jsi_Obj *obj = rv->d.obj;
specPtr = specs;
while (specPtr->id>=JSI_OPTION_BOOL && specPtr->id < JSI_OPTION_END && specPtr->name) {
Jsi_Value *vv = Jsi_ValueNew1(interp);
if (jsi_GetOption(interp, specPtr, record, NULL, &vv, flags) != JSI_OK) {
Jsi_DecrRefCount(interp, vv);
Jsi_DecrRefCount(interp, rv);
return JSI_ERROR;
}
if (flags&JSI_OPTS_VERBOSE) {
// dump: id,value,help,info,init
Jsi_Value *vrv = Jsi_ValueMakeObject(interp, NULL, NULL);
Jsi_IncrRefCount(interp, vrv);
Jsi_Obj *vobj = vrv->d.obj;
Jsi_ObjInsert(interp, vobj, "value", vv, 0);
Jsi_DecrRefCount(interp, vv);
vv = vrv;
jsi_DumpOptionSpec(interp, vobj, specPtr, 0);
}
Jsi_ObjInsert(interp, obj, specPtr->name, vv, 0);
Jsi_DecrRefCount(interp, vv);
count++;
i++;
specPtr++;
}
assert(specPtr->id == JSI_OPTION_END);
Jsi_ValueReplace(interp, ret, rv);
Jsi_DecrRefCount(interp, rv);
return JSI_OK;
} | 102,381,753,819,110,320,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,646 | 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 interpObjErase(InterpObj *fo)
{
SIGASSERTV(fo,INTERPOBJ);
if (fo->subinterp) {
Jsi_Interp *interp = fo->subinterp;
fo->subinterp = NULL;
Jsi_InterpDelete(interp);
/*fclose(fo->fp);
Jsi_Free(fo->interpname);
Jsi_Free(fo->mode);*/
}
fo->subinterp = NULL;
} | 274,581,166,517,655,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,647 | 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_HashFree(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *ptr) {
Jsi_Free(ptr);
return JSI_OK;
} | 192,677,085,743,354,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,648 | 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_CleanValue(Jsi_Interp *interp, Jsi_Interp *tointerp, Jsi_Value *val, Jsi_Value **ret)
{
Jsi_RC rc = JSI_OK;
const char *cp;
int len, iskey;
Jsi_Obj *obj;
switch (val->vt) {
case JSI_VT_UNDEF: Jsi_ValueMakeUndef(interp, ret); return rc;
case JSI_VT_NULL: Jsi_ValueMakeNull(tointerp, ret); return rc;
case JSI_VT_BOOL: Jsi_ValueMakeBool(tointerp, ret, val->d.val); return rc;
case JSI_VT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, val->d.num); return rc;
case JSI_VT_STRING:
iskey = val->f.bits.isstrkey;
cp = val->d.s.str;
len = val->d.s.len;
makestr:
if (iskey) {
Jsi_ValueMakeStringKey(interp, ret, cp);
return rc;
}
jsi_ValueMakeBlobDup(tointerp, ret, (uchar*)cp, len);
return rc;
case JSI_VT_OBJECT:
obj = val->d.obj;
switch (obj->ot) {
case JSI_OT_BOOL: Jsi_ValueMakeBool(tointerp, ret, obj->d.val); return rc;
case JSI_OT_NUMBER: Jsi_ValueMakeNumber(tointerp, ret, obj->d.num); return rc;
case JSI_OT_STRING:
cp = obj->d.s.str;
len = obj->d.s.len;
iskey = obj->isstrkey;
goto makestr;
default: break;
}
break;
default:
break;
}
Jsi_DString dStr;
Jsi_DSInit(&dStr);
cp = Jsi_ValueGetDString(interp, val, &dStr, JSI_OUTPUT_JSON);
if (Jsi_JSONParse(tointerp, cp, ret, 0) != JSI_OK) {
Jsi_DSFree(&dStr);
return Jsi_LogWarn("bad JSON parse in subinterp");
}
Jsi_DSFree(&dStr);
return rc;
} | 4,140,918,586,282,226,400,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,649 | 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_NumberIsWide(Jsi_Number n) { return (isnormal(n) && (Jsi_Number)((Jsi_Wide)(n)) == (n)); } | 13,376,450,168,469,022,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,650 | 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_TreeWalk(Jsi_Tree* treePtr, Jsi_TreeWalkProc* callback, void *data, int flags) {
Jsi_Interp *interp = treePtr->opts.interp;
JSI_NOTUSED(interp);
int n = 0, m = -1, lastm, order;
order = flags & JSI_TREE_ORDER_MASK;
switch (order) {
case JSI_TREE_ORDER_PRE:
return tree_preorder(treePtr, treePtr->root, callback, data);
case JSI_TREE_ORDER_POST:
return tree_postorder(treePtr, treePtr->root, callback, data);
case JSI_TREE_ORDER_IN:
return tree_inorder(treePtr, treePtr->root, callback, data);
case JSI_TREE_ORDER_LEVEL:
while (1) {
lastm = m;
if (tree_levelorder(treePtr, treePtr->root, callback, data, 0, n, &m) != JSI_OK)
return JSI_ERROR;
if (lastm == m)
return JSI_OK;
n++;
}
default:
Jsi_LogError("Invalid order: %d", order);
}
return JSI_ERROR;
} | 239,286,647,470,209,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,651 | 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 mdbStmtFreeProc(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *value) {
MySqlObj *jdb = (MySqlObj*)interp;
Jsi_ListEntry *l = (Jsi_ListEntry*)hPtr;
mdbRelease1Stmt(jdb, (MysqlPrep*)Jsi_ListValueGet(l));
return JSI_OK;
} | 339,817,365,694,531,960,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,652 | 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 jsiObjGetNames(Jsi_Interp *interp, Jsi_Obj *obj, Jsi_DString* dStr, int flags) {
Jsi_TreeEntry *hPtr;
Jsi_TreeSearch srch;
Jsi_Value *v;
int m = 0;
Jsi_DSInit(dStr);
if (obj->isarrlist)
obj = interp->Array_prototype->d.obj;
else if (!obj->tree->numEntries && obj->__proto__)
obj = obj->__proto__->d.obj;
for (hPtr=Jsi_TreeSearchFirst(obj->tree, &srch, JSI_TREE_ORDER_IN, NULL); hPtr; hPtr=Jsi_TreeSearchNext(&srch)) {
v = (Jsi_Value*)Jsi_TreeValueGet(hPtr);
if (!v) continue;
if ((flags&JSI_NAME_FUNCTIONS) && !Jsi_ValueIsFunction(interp,v)) {
continue;
}
if ((flags&JSI_NAME_DATA) && Jsi_ValueIsFunction(interp,v)) {
continue;
}
Jsi_DSAppend(dStr, (m++?" ":""), Jsi_TreeKeyGet(hPtr), NULL);
}
Jsi_TreeSearchDone(&srch);
} | 126,125,562,395,102,960,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,653 | 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 NumberToFixedCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
char buf[JSI_MAX_NUMBER_STRING+1];
int prec = 0, skip = 0;
Jsi_Number num;
Jsi_Value *v;
ChkStringN(_this, funcPtr, v);
Jsi_Value *pa = Jsi_ValueArrayIndex(interp, args, skip);
if (pa && Jsi_GetIntFromValue(interp, pa, &prec) != JSI_OK)
return JSI_ERROR;
if (prec<0) prec = 0;
Jsi_GetDoubleFromValue(interp, v, &num);
snprintf(buf, sizeof(buf), "%.*" JSI_NUMFFMT, prec, num);
Jsi_ValueMakeStringDup(interp, ret, buf);
return JSI_OK;
} | 152,242,778,841,734,600,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,654 | 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_insertln(Jsi_OpCodes *c, jsi_Eopcode code, void *extra, jsi_Pstate *pstate, jsi_Pline *line, 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].Line = line->first_line;
c->codes[c->code_len].Lofs = line->first_column;
c->codes[c->code_len].fname = jsi_PstateGetFilename(pstate);
c->codes[c->code_len].alloc = doalloc;
c->code_len ++;
return 0;
} | 32,184,556,752,108,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,655 | 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_ObjInsert(Jsi_Interp *interp, Jsi_Obj *obj, const char *key, Jsi_Value *val, int flags)
{
Jsi_TreeEntry *hPtr;
SIGASSERT(val, VALUE);
/*if (val)
Jsi_IncrRefCount(interp, val);*/
hPtr = Jsi_TreeObjSetValue(obj, key, val, (flags&JSI_OM_ISSTRKEY));
if ((flags&JSI_OM_DONTDEL))
val->f.bits.dontdel = hPtr->f.bits.dontdel = 1;
if ((flags&JSI_OM_READONLY))
val->f.bits.readonly =hPtr->f.bits.readonly = 1;
if ((flags&JSI_OM_DONTENUM))
val->f.bits.dontenum =hPtr->f.bits.dontenum = 1;
return hPtr;
} | 207,476,642,446,247,600,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,656 | 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 packageHashFree(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *ptr) {
jsi_PkgInfo *p = (jsi_PkgInfo*)ptr;
if (p->popts.info) Jsi_DecrRefCount(interp, p->popts.info);
Jsi_Free(p);
return JSI_OK;
} | 222,432,456,010,372,600,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,657 | 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 dbAuthCallback(
void *pArg,
int code,
const char *zArg1,
const char *zArg2,
const char *zArg3,
const char *zArg4
) {
const char *zCode;
int rc;
const char *zReply;
Jsi_Db *jdb = (Jsi_Db*)pArg;
Jsi_Interp *interp = jdb->interp;
if( jdb->disableAuth ) return SQLITE_OK;
switch( code ) {
case SQLITE_COPY :
zCode="SQLITE_COPY";
break;
case SQLITE_CREATE_INDEX :
zCode="SQLITE_CREATE_INDEX";
break;
case SQLITE_CREATE_TABLE :
zCode="SQLITE_CREATE_TABLE";
break;
case SQLITE_CREATE_TEMP_INDEX :
zCode="SQLITE_CREATE_TEMP_INDEX";
break;
case SQLITE_CREATE_TEMP_TABLE :
zCode="SQLITE_CREATE_TEMP_TABLE";
break;
case SQLITE_CREATE_TEMP_TRIGGER:
zCode="SQLITE_CREATE_TEMP_TRIGGER";
break;
case SQLITE_CREATE_TEMP_VIEW :
zCode="SQLITE_CREATE_TEMP_VIEW";
break;
case SQLITE_CREATE_TRIGGER :
zCode="SQLITE_CREATE_TRIGGER";
break;
case SQLITE_CREATE_VIEW :
zCode="SQLITE_CREATE_VIEW";
break;
case SQLITE_DELETE :
zCode="SQLITE_DELETE";
break;
case SQLITE_DROP_INDEX :
zCode="SQLITE_DROP_INDEX";
break;
case SQLITE_DROP_TABLE :
zCode="SQLITE_DROP_TABLE";
break;
case SQLITE_DROP_TEMP_INDEX :
zCode="SQLITE_DROP_TEMP_INDEX";
break;
case SQLITE_DROP_TEMP_TABLE :
zCode="SQLITE_DROP_TEMP_TABLE";
break;
case SQLITE_DROP_TEMP_TRIGGER :
zCode="SQLITE_DROP_TEMP_TRIGGER";
break;
case SQLITE_DROP_TEMP_VIEW :
zCode="SQLITE_DROP_TEMP_VIEW";
break;
case SQLITE_DROP_TRIGGER :
zCode="SQLITE_DROP_TRIGGER";
break;
case SQLITE_DROP_VIEW :
zCode="SQLITE_DROP_VIEW";
break;
case SQLITE_INSERT :
zCode="SQLITE_INSERT";
break;
case SQLITE_PRAGMA :
zCode="SQLITE_PRAGMA";
break;
case SQLITE_READ :
zCode="SQLITE_READ";
break;
case SQLITE_SELECT :
zCode="SQLITE_SELECT";
break;
case SQLITE_TRANSACTION :
zCode="SQLITE_TRANSACTION";
break;
case SQLITE_UPDATE :
zCode="SQLITE_UPDATE";
break;
case SQLITE_ATTACH :
zCode="SQLITE_ATTACH";
break;
case SQLITE_DETACH :
zCode="SQLITE_DETACH";
break;
case SQLITE_ALTER_TABLE :
zCode="SQLITE_ALTER_TABLE";
break;
case SQLITE_REINDEX :
zCode="SQLITE_REINDEX";
break;
case SQLITE_ANALYZE :
zCode="SQLITE_ANALYZE";
break;
case SQLITE_CREATE_VTABLE :
zCode="SQLITE_CREATE_VTABLE";
break;
case SQLITE_DROP_VTABLE :
zCode="SQLITE_DROP_VTABLE";
break;
case SQLITE_FUNCTION :
zCode="SQLITE_FUNCTION";
break;
case SQLITE_SAVEPOINT :
zCode="SQLITE_SAVEPOINT";
break;
default :
zCode="????";
break;
}
int i = 0;
Jsi_Value *vpargs, *items[10] = {}, *ret;
items[i++] = Jsi_ValueNewObj(interp, jdb->fobj);
items[i++] = Jsi_ValueMakeStringDup(interp, NULL, zCode);
items[i++] = Jsi_ValueMakeStringDup(interp, NULL, zArg1 ? zArg1 : "");
items[i++] = Jsi_ValueMakeStringDup(interp, NULL, zArg2 ? zArg2 : "");
items[i++] = Jsi_ValueMakeStringDup(interp, NULL, zArg3 ? zArg3 : "");
items[i++] = Jsi_ValueMakeStringDup(interp, NULL, zArg4 ? zArg4 : "");
vpargs = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, items, i, 0));
Jsi_IncrRefCount(interp, vpargs);
ret = Jsi_ValueNew(interp);
rc = Jsi_FunctionInvoke(interp, jdb->onAuth, vpargs, &ret, NULL);
Jsi_DecrRefCount(interp, vpargs);
if (rc == JSI_OK && (zReply = Jsi_ValueGetStringLen(interp, ret, NULL)))
{
if( Jsi_Strcmp(zReply,"SQLITE_OK")==0 ) {
rc = SQLITE_OK;
} else if( Jsi_Strcmp(zReply,"SQLITE_DENY")==0 ) {
rc = SQLITE_DENY;
} else if( Jsi_Strcmp(zReply,"SQLITE_IGNORE")==0 ) {
rc = SQLITE_IGNORE;
} else {
rc = 999;
}
}
Jsi_DecrRefCount(interp, ret);
return rc;
} | 252,863,706,756,702,360,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,658 | 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_FunctionReturnIgnored(Jsi_Interp *interp, Jsi_Func *funcPtr) {
return funcPtr->callflags.bits.isdiscard;
} | 83,293,616,306,324,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,659 | 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_InterpGone( Jsi_Interp* interp)
{
return (interp == NULL || interp->deleting || interp->destroying || interp->exited);
} | 117,642,489,699,416,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,660 | 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 MYSQL* mdbConnect(Jsi_Interp *interp, MySqlObj* jdb)
{
return mysql_real_connect(jdb->db,
jdb->host?Jsi_ValueString(interp, jdb->host, NULL):NULL,
jdb->user, jdb->password, jdb->database,
jdb->port, 0, jdb->dbflags);
} | 79,227,200,079,656,060,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,661 | 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 KeyLockerTree(Jsi_Tree* tree, int lock) { return KeyLocker((Jsi_Hash*)tree, lock); } | 35,205,752,632,132,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,662 | 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_evalcode(jsi_Pstate *ps, Jsi_Func *func, Jsi_OpCodes *opcodes,
jsi_ScopeChain *scope, Jsi_Value *fargs,
Jsi_Value *_this,
Jsi_Value **vret)
{
Jsi_Interp *interp = ps->interp;
if (interp->exited)
return JSI_ERROR;
Jsi_RC rc;
jsi_Frame frame = *interp->framePtr;
frame.parent = interp->framePtr;
interp->framePtr = &frame;
frame.parent->child = interp->framePtr = &frame;
frame.ps = ps;
frame.ingsc = scope;
frame.incsc = fargs;
frame.inthis = _this;
frame.opcodes = opcodes;
frame.fileName = ((func && func->script)?func->script:interp->curFile);
frame.funcName = interp->curFunction;
frame.dirName = interp->curDir;
if (frame.fileName && frame.fileName == frame.parent->fileName)
frame.logflag = frame.parent->logflag;
else
frame.logflag = 0;
frame.level = frame.parent->level+1;
frame.evalFuncPtr = func;
frame.arguments = NULL;
// if (func && func->strict)
// frame.strict = 1;
if (interp->curIp)
frame.parent->line = interp->curIp->Line;
frame.ip = interp->curIp;
interp->refCount++;
interp->level++;
Jsi_IncrRefCount(interp, fargs);
rc = jsi_evalcode_sub(ps, opcodes, scope, fargs, _this, *vret);
Jsi_DecrRefCount(interp, fargs);
if (interp->didReturn == 0 && !interp->exited && rc == JSI_OK) {
if ((interp->evalFlags&JSI_EVAL_RETURN)==0)
Jsi_ValueMakeUndef(interp, vret);
/*if (interp->framePtr->Sp != oldSp) //TODO: at some point after memory refs???
Jsi_LogBug("Stack not balance after execute script");*/
}
if (frame.arguments)
Jsi_DecrRefCount(interp, frame.arguments);
interp->didReturn = 0;
interp->refCount--;
interp->level--;
interp->framePtr = frame.parent;
interp->framePtr->child = NULL;
interp->curIp = frame.ip;
if (interp->exited)
rc = JSI_ERROR;
return rc;
} | 152,871,584,791,788,250,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,663 | 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_func_sub(jsi_Pstate *p, jsi_Pline *line, Jsi_Func *fun) { p->funcDefs++; JSI_NEW_CODESLN(0,OP_PUSHFUN, fun); } | 27,737,289,742,505,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,664 | 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 *get_current_dir_name() {
static char buf[MAX_PATH] = ".";
getcwd(buf, sizeof(buf));
return buf;
} | 13,733,001,296,257,378,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,665 | 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_CurrentThread(void) {
#ifdef __WIN32
return (void*)(uintptr_t)GetCurrentThreadId();
#else
return (void*)pthread_self();
#endif
} | 338,604,126,507,692,970,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,666 | 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 const char *mdbFindEndStr(const char *cp) {
const char endc = *cp;
cp++;
while (*cp && *cp != endc) {
if (*cp == '\\' && cp[1]) cp++;
cp++;
}
if (*cp != endc)
return NULL;
return ++cp;
} | 69,629,290,388,762,810,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,667 | 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 mdbClose(MYSQL *db) {
mysql_close(db);
} | 252,993,523,619,439,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,668 | 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_InterpSetData(Jsi_Interp *interp, const char *key, void *data, Jsi_DeleteProc *proc)
{
bool isNew;
Jsi_HashEntry *hPtr;
AssocData *ptr;
hPtr = Jsi_HashEntryNew(interp->assocTbl, key, &isNew);
if (!hPtr)
return;
if (isNew) {
ptr = (AssocData *)Jsi_Calloc(1,sizeof(*ptr));
Jsi_HashValueSet(hPtr, ptr);
} else
ptr = (AssocData *)Jsi_HashValueGet(hPtr);
ptr->data = data;
ptr->delProc = proc;
} | 329,630,433,087,557,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,669 | 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_pos() { JSI_NEW_CODES(0,OP_POS, 0); } | 127,652,281,846,344,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,670 | 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 mysqlObjFree(Jsi_Interp *interp, void *data)
{
MySqlObj *jdb = (MySqlObj*)data;
SQLSIGASSERT(jdb,DB);
jdb->_->activeCnt--;
mysqlObjErase(jdb);
_JSI_MEMCLEAR(jdb);
Jsi_Free(jdb);
return JSI_OK;
} | 310,165,027,963,988,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,671 | 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_VerifyToValue(Jsi_Interp *interp, Jsi_OptionSpec* spec, Jsi_Value **outValue, Jsi_DString *dStr, void *record, Jsi_Wide flags)
{
if (dStr)
return JSI_ERROR;
Jsi_Value **s = (Jsi_Value**)(((char*)record) + spec->offset);
if (*s)
Jsi_ValueReplace(interp, outValue, *s);
return JSI_OK;
} | 198,546,062,223,963,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,672 | 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 RegexpExecCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
int skip = 0;
Jsi_Value *v;
ChkRegexp(_this, funcPtr, v);
/* TODO: add lastIndex support. */
int slen;
char *str = Jsi_ValueString(interp,Jsi_ValueArrayIndex(interp, args, skip), &slen);
if (!str)
return Jsi_LogError("expected string");
if (v == NULL || v->vt != JSI_VT_OBJECT || v->d.obj->ot != JSI_OT_REGEXP)
return Jsi_LogError("expected pattern");
Jsi_Regex *re = v->d.obj->d.robj;
int isglob = (re->eflags&JSI_REG_GLOB);
Jsi_Value *l = NULL;
Jsi_Number lv = 0;
if (isglob) {
l = Jsi_ValueObjLookup(interp, v, "lastIndex", 0);
if (l && Jsi_ValueGetNumber(interp, l, &lv) != JSI_OK)
return Jsi_LogError("lastIndex not a number");
if (l)
re->lastIndex = (int)lv;
}
int ofs = 0;
Jsi_RC rc = jsi_RegExpMatches(interp, v, re->lastIndex<slen?str+re->lastIndex:"", -1, *ret, isglob?&ofs:NULL, 0);
if (isglob) {
if (rc != JSI_OK)
return rc;
re->lastIndex += ofs;
if (Jsi_ValueIsNull(interp, *ret))
re->lastIndex = 0;
lv = (Jsi_Number)re->lastIndex;
if (!l)
Jsi_ValueInsert(interp, v, "lastIndex", Jsi_ValueNewNumber(interp, lv), JSI_OM_DONTDEL);
else if (l->vt == JSI_VT_NUMBER)
l->d.num = lv;
else if (l->vt == JSI_VT_OBJECT && l->d.obj->ot == JSI_OT_NUMBER)
l->d.obj->d.num = lv;
}
return rc;
} | 176,182,452,795,284,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,673 | 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_FSScandirProc(Jsi_Interp *interp, Jsi_Value *path, Jsi_Dirent ***namelist,
int (*filter)(const Jsi_Dirent *), int (*compar)(const Jsi_Dirent **, const Jsi_Dirent**))
{
const char *dirname = Jsi_ValueToString(interp, path, NULL);
Jsi_DString dStr = {};
if (*dirname == '~')
dirname = jsi_TildePath(interp, dirname, &dStr);
int rc = scandir(dirname, namelist, filter, compar);
Jsi_DSFree(&dStr);
return rc;
} | 309,811,872,677,756,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,674 | 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 StringConstructor(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
if (Jsi_FunctionIsConstructor(funcPtr)) {
const char *nv = "";
int len = -1;
if (Jsi_ValueGetLength(interp, args) > 0) {
Jsi_Value *v = Jsi_ValueArrayIndex(interp, args, 0);
if (v) {
nv = Jsi_ValueToString(interp, v, &len);
}
}
if (_this->vt == JSI_VT_OBJECT && _this->d.obj->ot == JSI_OT_STRING) {
if (_this->d.obj->d.s.str)
if (!_this->d.obj->isstrkey)
Jsi_Free(_this->d.obj->d.s.str);
_this->d.obj->isstrkey = 0;
_this->d.obj->d.s.str = Jsi_StrdupLen(nv, len);
_this->d.obj->d.s.len = len;
} else
jsi_ValueMakeBlobDup(interp, &_this, (uchar*)nv, len);
Jsi_ValueDup2(interp, ret, _this);
return JSI_OK;
}
if (Jsi_ValueGetLength(interp, args) > 0) {
Jsi_Value *v = Jsi_ValueArrayIndex(interp, args, 0);
if (v) {
Jsi_ValueDup2(interp, ret, v);
Jsi_ValueToString(interp, *ret, NULL);
return JSI_OK;
}
}
Jsi_ValueMakeStringDup(interp, ret, "");
return JSI_OK;
} | 80,261,835,126,337,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,675 | 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_ValueGetBoolean(Jsi_Interp *interp, Jsi_Value *pv, bool *val)
{
if (!pv) return JSI_ERROR;
if (pv->vt == JSI_VT_BOOL)
*val = pv->d.val;
else if (pv->vt == JSI_VT_OBJECT && pv->d.obj->ot == JSI_OT_BOOL)
*val = pv->d.obj->d.val;
else
return JSI_ERROR;
return JSI_OK;
} | 316,072,898,917,331,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,676 | 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_DeleteSpecCacheTable(Jsi_Interp *interp, void *clientData)
{
Jsi_Hash *tablePtr = (Jsi_Hash *) clientData;
Jsi_HashEntry *entryPtr;
Jsi_HashSearch search;
for (entryPtr = Jsi_HashSearchFirst(tablePtr,&search); entryPtr != NULL;
entryPtr = Jsi_HashSearchNext(&search)) {
Jsi_Free(Jsi_HashValueGet(entryPtr));
}
Jsi_HashDelete(tablePtr);
return JSI_OK;
} | 194,295,462,695,766,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,677 | 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 dbOutputHexBlob(Jsi_DString *dStr, const void *pBlob, int nBlob){
int i;
char out[JSI_MAX_NUMBER_STRING], *zBlob = (char *)pBlob;
Jsi_DSAppend(dStr, "X'", NULL);
for(i=0; i<nBlob; i++){ snprintf(out, sizeof(out),"%02x",zBlob[i]&0xff);Jsi_DSAppend(dStr, out, NULL); }
Jsi_DSAppend(dStr, "'", NULL);
} | 181,868,690,832,673,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,678 | 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_wsDumpQuery(jsi_wsCmdObj *cmdPtr, jsi_wsPss *pss, const char *name, Jsi_Value **ret)
{
int n = 0;
Jsi_Interp *interp = cmdPtr->interp;
Jsi_Obj *nobj;
Jsi_Value *nv;
if (!name) {
nobj = Jsi_ObjNewType(interp, JSI_OT_OBJECT);
Jsi_ValueMakeObject(interp, ret, nobj);
}
for (n = 0; n<pss->paramc; n++) {
const char *cp = lws_spa_get_string(pss->spa, n);
if (!cp) cp = "";
if (name) {
if (Jsi_Strcmp(name, pss->paramv[n])) { n++; continue; }
Jsi_ValueMakeStringDup(interp, ret, cp);
return;
}
nv = Jsi_ValueNewStringDup(interp, cp);
Jsi_ObjInsert(interp, nobj, pss->paramv[n], nv, 0);
}
} | 16,143,333,475,266,476,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,679 | 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_Puts(Jsi_Interp *interp, Jsi_Channel chan, const char *str, int size)
{
int code = 0, len = Jsi_Strlen(str);
if (chan->fsPtr==0 || !chan->fsPtr->putsProc) {
FILE *fp = (chan && chan->fp ? chan->fp : stdout);
code = fputs(str, fp);
} else {
if (interp && interp->debugOpts.putsCallback && interp->parent) {
int code = 0;
Jsi_DString jStr={}, kStr={};
Jsi_DSPrintf(&kStr, "[%s, %d]",
Jsi_JSONQuote(interp, str, size, &jStr), (chan->fp == stderr?1:0));
if (Jsi_FunctionInvokeJSON(interp->parent, interp->debugOpts.putsCallback, Jsi_DSValue(&kStr), NULL) != JSI_OK)
code = 1;
Jsi_DSFree(&jStr);
Jsi_DSFree(&kStr);
return code;
} else if (interp && interp->stdoutStr) {
Jsi_DString dStr = {};
Jsi_DSAppend(&dStr, Jsi_ValueString(interp, interp->stdoutStr, NULL), NULL);
Jsi_DSAppend(&dStr, str, NULL);
Jsi_ValueFromDS(interp, &dStr, &interp->stdoutStr);
} else
code = chan->fsPtr->putsProc(chan, str);
}
if (size>=0 && len < size) {
Jsi_Puts(interp, chan, "\\0", -1);
Jsi_Puts(interp, chan, str+len+1, size-len-1);
}
return code;
} | 323,259,497,415,471,970,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,681 | 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_FuncObj *jsi_FuncObjNew(Jsi_Interp *interp, Jsi_Func *func)
{
Jsi_FuncObj *f = (Jsi_FuncObj*)Jsi_Calloc(1,sizeof(Jsi_FuncObj));
f->interp = interp;
SIGINIT(f,FUNCOBJ);
f->func = func;
func->refCnt++;
return f;
} | 186,424,592,479,172,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,682 | 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 | HashOneWord(
Jsi_Hash *tablePtr,
const void *key)
{
uint64_t a0, a1;
uint64_t y0, y1;
uint64_t y2, y3;
uint64_t p1, p2;
uint64_t result;
/* Compute key * GOLDEN_RATIO in 128-bit arithmetic */
a0 = (uint64_t)key & 0x00000000FFFFFFFF;
a1 = (uint64_t)key >> 32;
y0 = a0 * 0x000000007f4a7c13;
y1 = a0 * 0x000000009e3779b9;
y2 = a1 * 0x000000007f4a7c13;
y3 = a1 * 0x000000009e3779b9;
y1 += y0 >> 32; /* Can't carry */
y1 += y2; /* Might carry */
if (y1 < y2) {
y3 += (1LL << 32); /* Propagate */
}
/* 128-bit product: p1 = loword, p2 = hiword */
p1 = ((y1 & 0x00000000FFFFFFFF) << 32) + (y0 & 0x00000000FFFFFFFF);
p2 = y3 + (y1 >> 32);
/* Left shift the value downward by the size of the table */
if (tablePtr->downShift > 0) {
if (tablePtr->downShift < 64) {
result = ((p2 << (64 - tablePtr->downShift)) |
(p1 >> (tablePtr->downShift & 63)));
} else {
result = p2 >> (tablePtr->downShift & 63);
}
} else {
result = p1;
}
/* Finally mask off the high bits */
return (jsi_Hash)(result & tablePtr->mask);
} | 101,013,910,446,078,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,683 | 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 mdbStmtLimit( MySqlObj *jdb)
{
while(jdb->numStmts>jdb->maxStmts ) {
Jsi_ListEntry *l = Jsi_ListPopBack(jdb->stmtCache);
mdbRelease1Stmt(jdb, (MysqlPrep*)Jsi_ListValueGet(l));
jdb->numStmts = Jsi_ListSize(jdb->stmtCache);
}
} | 311,652,217,216,672,440,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,684 | 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_NullToValue(Jsi_Interp *interp, Jsi_OptionSpec* spec, Jsi_Value **outValue, Jsi_DString *outStr, void *record, Jsi_Wide flags)
{
Jsi_ValueMakeNull(interp, outValue);
return JSI_OK;
} | 177,485,671,961,582,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,685 | 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_Tree *Jsi_TreeFromValue(Jsi_Interp *interp, Jsi_Value *v)
{
if (!Jsi_ValueIsObjType(interp, v, JSI_OT_OBJECT))
return NULL;
return v->d.obj->tree;
} | 238,875,281,950,989,080,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,686 | 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_OptionsGet(Jsi_Interp *interp, Jsi_OptionSpec *specs, void *rec, const char *option, Jsi_Value** valuePtr, Jsi_Wide flags)
{
char *record = (char*)rec;
Jsi_OptionSpec *specPtr;
const char *cp = NULL, *cb = NULL;
if (option) {
cp = Jsi_Strchr(option, '.');
cb = Jsi_Strchr(option, '[');
}
if (cp && (!cb || cp<cb) ) {
Jsi_DString dStr;
int len = (cp-option);
Jsi_DSInit(&dStr);
cp = Jsi_DSAppendLen(&dStr, option, len);
specPtr = Jsi_OptionsFind(interp, specs, cp, flags);
Jsi_DSFree(&dStr);
if (!specPtr || !specPtr->data || specPtr->id != JSI_OPTION_CUSTOM || specPtr->custom != Jsi_Opt_SwitchSuboption)
return Jsi_LogError("unknown or bad sub-config option: %s", option);
cp = option+len+1;
return Jsi_OptionsGet(interp, (Jsi_OptionSpec *)(specPtr->data), (void*)(((char*)rec)+specPtr->offset), cp, valuePtr, flags);
}
if (cb && cb != option) {
char *ce = Jsi_Strchr(option, ']');
Jsi_Wide ul;
Jsi_DString dStr;
Jsi_DSInit(&dStr);
int len = 0;
if (ce && ce>cb) {
len = (ce-cb-1);
cp = Jsi_DSAppendLen(&dStr, cb+1, len);
}
if (len <= 0 || Jsi_GetWide(interp, cp, &ul, 0) != JSI_OK || ul<0)
return Jsi_LogError("bad sub-array option: %s", option);
len = (cb-option);
Jsi_DSSetLength(&dStr, 0);
cp = Jsi_DSAppendLen(&dStr, option, len);
specPtr = Jsi_OptionsFind(interp, specs, cp, flags);
Jsi_DSFree(&dStr);
if (!specPtr || !specPtr->init.OPT_CARRAY|| specPtr->id != JSI_OPTION_CUSTOM || specPtr->custom != Jsi_Opt_SwitchCArray) {
bail:
return Jsi_LogError("unknown or bad array option: %s", option);
}
cp = cb+1;
Jsi_OptionSpec *subSpec = specPtr->init.OPT_CARRAY;
int isize, size = specPtr->arrSize;
if (!subSpec || size<=0 || (isize=subSpec->size)<=0)
goto bail;
isize = isize/size;
uchar *s = (((uchar*)rec)+specPtr->offset + isize*ul);
if (ce[1] != '.' || !subSpec->data) {
if (Jsi_OptionsGet(interp, subSpec, (void*)s, subSpec->name, valuePtr, flags) != JSI_OK)
return JSI_ERROR;
} else {
if (Jsi_OptionsGet(interp, (Jsi_OptionSpec *)subSpec->data, (void*)s, ce+2, valuePtr, flags) != JSI_OK)
return JSI_ERROR;
}
return JSI_OK;
}
specPtr = Jsi_OptionsFind(interp, specs, option, flags);
if (specPtr == NULL || jsi_GetOption(interp, specPtr, record, option, valuePtr, flags) != JSI_OK) {
return JSI_ERROR;
}
return JSI_OK;
} | 39,337,935,906,093,714,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,687 | 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_DumpOptionSpec(Jsi_Interp *interp, Jsi_Obj *nobj, Jsi_OptionSpec* spec, int addName)
{
if (addName)
Jsi_ObjInsert(interp, nobj, "name", Jsi_ValueNewStringKey(interp, spec->name),0);
if (spec->help) {
if (Jsi_Strchr(spec->help, '\n'))
Jsi_LogError("%s .help contains newline: %s", spec->name, spec->help);
Jsi_ObjInsert(interp, nobj, "help", Jsi_ValueNewStringKey(interp, spec->help),0);
}
if (spec->info)
Jsi_ObjInsert(interp, nobj, "info", Jsi_ValueNewStringKey(interp, spec->info),0);
Jsi_ObjInsert(interp, nobj, "type", Jsi_ValueNewStringKey(interp, jsi_OptionTypeStr(spec->id,0)),0);
Jsi_ObjInsert(interp, nobj, "cName", Jsi_ValueNewStringKey(interp, jsi_OptionTypeStr(spec->id,1)),0);
Jsi_ObjInsert(interp, nobj, "initOnly", Jsi_ValueNewBoolean(interp, (spec->flags & JSI_OPT_INIT_ONLY)!=0), 0);
Jsi_ObjInsert(interp, nobj, "readOnly", Jsi_ValueNewBoolean(interp, (spec->flags & JSI_OPT_READ_ONLY)!=0), 0);
Jsi_ObjInsert(interp, nobj, "required", Jsi_ValueNewBoolean(interp, (spec->flags & JSI_OPT_REQUIRED)!=0), 0);
Jsi_ObjInsert(interp, nobj, "noCase", Jsi_ValueNewBoolean(interp, (spec->flags & JSI_OPT_CUST_NOCASE)!=0), 0);
Jsi_ObjInsert(interp, nobj, "size", Jsi_ValueNewNumber(interp, (Jsi_Number)spec->size), 0);
if (spec->flags)
Jsi_ObjInsert(interp, nobj, "flags", Jsi_ValueNewNumber(interp, (Jsi_Number)spec->flags), 0);
if (spec->data) {
if (spec->id == JSI_OPTION_FUNC && spec->data)
Jsi_ObjInsert(interp, nobj, "args", Jsi_ValueNewStringDup(interp, (char*)spec->data), 0);
else if (spec->id == JSI_OPTION_CUSTOM && (spec->custom == Jsi_Opt_SwitchBitset ||
spec->custom == Jsi_Opt_SwitchEnum)) {
const char **list = jsi_OptGetEnumList(spec);
if (list)
Jsi_ObjInsert(interp, nobj, "data", Jsi_ValueNewArray(interp, list, -1), 0);
}
}
if (spec->id == JSI_OPTION_CUSTOM && spec->custom) {
Jsi_Obj *sobj = Jsi_ObjNewType(interp, JSI_OT_OBJECT);
Jsi_Value *cvalue = Jsi_ValueMakeObject(interp, NULL, sobj);
jsi_DumpCustomSpec(interp, sobj, spec);
Jsi_ObjInsert(interp, nobj, "customArg", cvalue,0);
Jsi_OptionSpec *os = spec;
while (os->id != JSI_OPTION_END) os++;
Jsi_ObjInsert(interp, nobj, "customArgHelp", Jsi_ValueNewStringKey(interp, (os->help?os->help:"")), 0);
}
} | 269,553,386,142,137,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,688 | 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_ValueIsNumber(Jsi_Interp *interp, Jsi_Value *pv)
{
return (pv->vt == JSI_VT_NUMBER || (pv->vt == JSI_VT_OBJECT && pv->d.obj->ot == JSI_OT_NUMBER));
} | 1,350,660,947,729,997,800,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,689 | 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_case4(Jsi_TreeEntry* n) {
Jsi_TreeEntry* g = grandparent(n);
if (n == n->parent->right && n->parent == g->left) {
rotate_left(n->parent);
n = n->left;
} else if (n == n->parent->left && n->parent == g->right) {
rotate_right(n->parent);
n = n->right;
}
insert_case5(n);
} | 162,587,668,824,969,410,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,690 | 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 | HashOneWordFind( Jsi_Hash *tablePtr, const void *key)
{
Jsi_HashEntry *hPtr;
size_t hindex;
hindex = RANDOM_INDEX(tablePtr, key);
/*
* Search all of the entries in the appropriate bucket.
*/
for (hPtr = tablePtr->buckets[hindex]; hPtr != NULL;
hPtr = hPtr->nextPtr) {
if (hPtr->key.oneWordValue == key) {
return hPtr;
}
}
return NULL;
} | 229,007,784,558,446,760,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,691 | 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 jsiPop(Jsi_Interp* interp, int n) {
int t = n;
while (t > 0) {
Assert((interp->framePtr->Sp-t)>=0);
/* Jsi_Value *v = _jsi_STACKIDX(interp->framePtr->Sp-t);
if (v->refCnt>1) puts("OO");*/
jsiClearStack(interp,t);
--t;
}
interp->framePtr->Sp -= n;
} | 18,667,655,662,740,695,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,692 | 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 mysqlObjEqual(void *data1, void *data2)
{
//SQLSIGASSERT(data1,DB);
//SQLSIGASSERT(data2,DB);
return (data1 == data2);
} | 319,817,762,070,043,520,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,693 | 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 _StringTrimCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, // TODO: UTF
Jsi_Value **ret, Jsi_Func *funcPtr, int ends)
{
const char *tstr = " \t\n\r", *vstr;
int vend, n, tlen = Jsi_Strlen(tstr), clen, bLen;
ChkString(_this, funcPtr, vstr, &clen, &bLen);
Jsi_Value *tchars = Jsi_ValueArrayIndex(interp, args, skip);
if (tchars) {
tstr = Jsi_ValueToString(interp, tchars, NULL);
tlen = Jsi_Strlen(tstr);
}
if (ends&1) {
while (*vstr) {
for (n=0; n<tlen; n++)
if (tstr[n] == *vstr) break;
if (n>=tlen) break;
vstr++;
clen--;
}
}
vend = clen-1;
if (ends&2) {
for (; vend>=0; vend--) {
for (n=0; n<tlen; n++)
if (tstr[n] == vstr[vend]) break;
if (n>=tlen) break;
}
}
Jsi_DString dStr;
Jsi_DSInit(&dStr);
Jsi_UtfSubstr(vstr, 0, vend+1, &dStr);
Jsi_ValueFromDS(interp, &dStr, ret);
return JSI_OK;
} | 288,919,796,757,333,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,694 | 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 interpObjIsTrue(void *data)
{
InterpObj *fo = (InterpObj *)data;
SIGASSERT(fo,INTERPOBJ);
if (!fo->subinterp) return 0;
else return 1;
} | 243,047,512,778,365,870,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,695 | 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_HashConf(Jsi_Hash *hashPtr, Jsi_MapOpts *opts, bool set)
{
if (set)
hashPtr->opts = *opts;
else
*opts = hashPtr->opts;
return JSI_OK;
} | 312,839,759,889,234,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,696 | 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_MapEntry* Jsi_MapEntryFind (Jsi_Map *mapPtr, const void *key){
SIGASSERT(mapPtr, MAP);
switch (mapPtr->typ) {
case JSI_MAP_HASH: return (Jsi_MapEntry*)Jsi_HashEntryFind(mapPtr->v.hash, key);
case JSI_MAP_TREE: return (Jsi_MapEntry*)Jsi_TreeEntryFind(mapPtr->v.tree, key);
case JSI_MAP_LIST:
return (Jsi_MapEntry*) (key == NULL? Jsi_ListGetFront(mapPtr->v.list) : Jsi_ListGetBack(mapPtr->v.list));
case JSI_MAP_NONE: break;
}
return NULL;
} | 267,785,101,272,754,360,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,697 | 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_Number Jsi_NumberNaN(void)
{
return NAN;
} | 213,152,582,794,385,280,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,698 | 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_ValueInstanceOf( Jsi_Interp *interp, Jsi_Value* v1, Jsi_Value* v2)
{
Jsi_Value *proto, *sproto;
if (v1->vt != JSI_VT_OBJECT || v2->vt != JSI_VT_OBJECT || v2->d.obj->ot != JSI_OT_FUNCTION)
return 0;
proto = Jsi_ValueObjLookup(interp, v2, "prototype", 0);
if (!proto)
return 0;
sproto = v1->d.obj->__proto__ ;
while (sproto) {
if (sproto == proto)
return 1;
if (sproto->vt != JSI_VT_OBJECT)
return 0;
sproto = sproto->d.obj->__proto__;
}
return 0;
} | 15,294,754,993,995,751,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,699 | 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_with(jsi_Pstate *p, jsi_Pline *line, int withlen) { JSI_NEW_CODESLN(0,OP_WITH, withlen); } | 72,827,559,313,660,760,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,700 | 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 MySqlReconnectCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
MySqlObj *jdb = _mysql_getDbHandle(interp, _this, funcPtr);
if (!jdb) return JSI_ERROR;
int oldMax = jdb->maxStmts;
jdb->maxStmts = 0;
mdbStmtLimit(jdb);
jdb->maxStmts = oldMax;
mysql_close(jdb->db);
jdb->db = mysql_init(NULL);
if (!mdbConnect(interp, jdb))
return Jsi_LogError("reconnect failed: %s", mysql_error(jdb->db));
return JSI_OK;
} | 35,933,687,335,052,925,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,701 | 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_MapEntry* Jsi_MapSearchNext (Jsi_MapSearch *searchPtr){
switch (searchPtr->typ) {
case JSI_MAP_HASH: return (Jsi_MapEntry*)Jsi_HashSearchNext(&searchPtr->v.hash);
case JSI_MAP_TREE: return (Jsi_MapEntry*)Jsi_TreeSearchNext(&searchPtr->v.tree);
case JSI_MAP_LIST: return (Jsi_MapEntry*)Jsi_ListSearchNext(&searchPtr->v.list);
case JSI_MAP_NONE: break;
}
return NULL;
} | 204,126,990,037,215,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,702 | 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_DoneWebSocket(Jsi_Interp *interp)
{
Jsi_UserObjUnregister(interp, &websockobject);
Jsi_PkgProvide(interp, "WebSocket", -1, NULL);
return JSI_OK;
} | 82,178,317,850,380,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,703 | 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 MySqlOnecolumnCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
Jsi_RC rc;
MySqlObj *jdb;
if (!(jdb = _mysql_getDbHandle(interp, _this, funcPtr))) return JSI_ERROR;
Jsi_Value *vSql = Jsi_ValueArrayIndex(interp, args, 0);
Jsi_DString dStr;
Jsi_DSInit(&dStr);
Jsi_DString sStr;
Jsi_DSInit(&sStr);
MyDbEvalContext sEval = {};
const char *zSql = Jsi_ValueGetDString(interp, vSql, &dStr, 0);
sEval.nocache = jdb->queryOpts.nocache;
if (mdbEvalInit(interp, &sEval, jdb, zSql, &sStr, 0, 0) != JSI_OK)
return JSI_ERROR;
sEval.ret = *ret;
sEval.tocall = NULL;
int cnt = 0;
if( JSI_OK==(rc = mdbEvalStep(&sEval)) ) {
int nCol = sEval.prep->numCol;
if (nCol>0)
mdbEvalSetColumnValue(&sEval, 0, ret);
cnt++;
}
mdbEvalFinalize(&sEval);
if( rc==JSI_BREAK ) {
rc = JSI_OK;
}
Jsi_DSFree(&dStr);
return rc;
} | 172,084,266,179,804,260,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,704 | 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_FuncArgsToString(Jsi_Interp *interp, Jsi_Func *f, Jsi_DString *dStr, int withTypes)
{
if (f->type == FC_NORMAL) {
int i;
for (i = 0; i < f->argnames->count; ++i) {
jsi_ArgValue *av = f->argnames->args+i;
if (i) Jsi_DSAppend(dStr, ", ", NULL);
Jsi_DSAppend(dStr, jsi_ScopeStrsGet(f->argnames, i), NULL);
if (withTypes && av) {
Jsi_DString tStr = {};
int atyp = av->type;
if (av->defValue)
atyp &= ~(av->defValue->vt==JSI_VT_NULL?JSI_TT_NULL:(1<<av->defValue->vt));
if (atyp) {
Jsi_DSAppend(dStr, ":", jsi_typeName(interp, atyp, &tStr), NULL);
}
Jsi_DSSetLength(&tStr, 0);
if (av->defValue)
Jsi_DSAppend(dStr, "=", Jsi_ValueGetDString(interp, av->defValue, &tStr, 1), NULL);
Jsi_DSFree(&tStr);
}
}
} else if (f->cmdSpec && f->cmdSpec->argStr)
Jsi_DSAppend(dStr, f->cmdSpec->argStr, NULL);
return JSI_OK;
} | 257,464,811,415,807,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,705 | 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_HashEntry* Jsi_HashSet(Jsi_Hash *tbl, const void *key, void *value) {
Jsi_HashEntry *hPtr;
bool isNew;
hPtr = Jsi_HashEntryNew(tbl, key, &isNew);
if (!hPtr) return hPtr;
Jsi_HashValueSet(hPtr, value);
return hPtr;
} | 175,980,394,753,508,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,706 | 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 FilesysCloseCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
UdfGet(udf, _this, funcPtr);
fileObjErase(udf);
Jsi_ValueMakeBool(interp, ret, 1);
return JSI_OK;
} | 265,330,049,938,605,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,707 | 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_EnumToValue(Jsi_Interp *interp, Jsi_OptionSpec* spec, Jsi_Value **outValue, Jsi_DString *outStr, void *record, Jsi_Wide flags)
{
uint i = 0, j, esiz = 0;
int64_t n;
char *s = (char*)(((char*)record) + spec->offset);
const char **list = (const char**)spec->data;
Jsi_OptionSpec* es=NULL, *esp = NULL;
int fflags = (flags|spec->flags);
int uflag = (fflags&JSI_OPT_ENUM_UNSIGNED);
if (list && (fflags & JSI_OPT_ENUM_SPEC)) {
esp = es = (typeof(es))list;
while (es->id != JSI_OPTION_END) es++;
list = es->init.STRKEY;
esiz = es->size;
es = (typeof(es))spec->data;
}
if (!list)
return Jsi_LogError("custom enum spec did not set data: %s", spec->name);
if (outStr) {
if (uflag) {
switch (spec->size) {
case 1: n = *(uint8_t*)s; break;
case 2: n = *(uint16_t*)s; break;
case 4: n = *(uint32_t*)s; break;
case 8: n = *(uint64_t*)s; break;
default:
return Jsi_LogError("enum size %d must be 1, 2, 4, or 8: %s", spec->size, spec->name);
}
} else {
switch (spec->size) {
case 1: n = *(int8_t*)s; break;
case 2: n = *(int16_t*)s; break;
case 4: n = *(int32_t*)s; break;
case 8: n = *(int64_t*)s; break;
default:
return Jsi_LogError("enum size %d must be 1, 2, 4, or 8: %s", spec->size, spec->name);
}
}
if (spec->flags&JSI_OPT_FMT_NUMBER) {
Jsi_DSPrintf(outStr, "%" PRIu64, (uint64_t)n);
return JSI_OK;
}
if (es) {
for (j=0; j<esiz && list[j]; j++) {
if (n == esp[j].value) {
i = j;
break;
}
if (j>=esiz)
i = esiz;
}
} else
for (i=0; i<n && list[i]; i++) ; /* Look forward til n */
if (list[i])
Jsi_DSAppendLen(outStr, list[i], -1);
else if ((spec->flags&JSI_OPT_COERCE)) {
Jsi_DSPrintf(outStr, "%" PRIu64, (uint64_t)n);
return JSI_OK;
} else
return Jsi_LogError("enum has unknown value: %d", *s);
return JSI_OK;
}
#ifndef JSI_LITE_ONLY
Jsi_DString dStr;
Jsi_DSInit(&dStr);
Jsi_RC rc = jsi_EnumToValue(interp, spec, NULL, &dStr, record, flags);
if (rc == JSI_OK)
Jsi_ValueMakeStringKey(interp, outValue, Jsi_DSValue(&dStr));
Jsi_DSFree(&dStr);
return rc;
#endif
return JSI_ERROR;
} | 243,068,255,535,448,600,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,708 | 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_Malloc(unsigned int size) {
void *v = malloc(size);
Assert(v);
return v;
} | 267,598,534,458,074,060,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,709 | 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_vtype Jsi_ValueTypeGet(Jsi_Value *pv) { return pv->vt; } | 244,181,069,599,245,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,710 | 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_PstatePop(jsi_Pstate *ps)
{
Jsi_Interp *interp = ps->interp;
if (interp->cur_scope <= 0) {
Jsi_LogBug("No more scope to pop");
return;
}
jsi_ScopeStrsFree(interp, interp->scopes[interp->cur_scope]);
interp->scopes[interp->cur_scope] = NULL;
interp->cur_scope--;
} | 207,010,074,288,643,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,711 | 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_wsGetCmd(Jsi_Interp *interp, jsi_wsCmdObj *cmdPtr, jsi_wsPss* pss, struct lws *wsi,
const char *inPtr, Jsi_Value *cmd, Jsi_DString *tStr)
{
Jsi_RC jrc;
Jsi_Value *retStr = Jsi_ValueNew1(interp);
// 4 args: ws, id, url, query
Jsi_Value *vpargs, *vargs[10];
int n = 0;
if (cmdPtr->deleted) return JSI_ERROR;
vargs[n++] = Jsi_ValueNewObj(interp, cmdPtr->fobj);
vargs[n++] = Jsi_ValueNewNumber(interp, (Jsi_Number)(pss?pss->wid:0));
vargs[n++] = Jsi_ValueNewStringDup(interp, inPtr);
vargs[n++] = (pss->query?pss->query:Jsi_ValueNewArray(interp, NULL, 0));
vpargs = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, vargs, n, 0));
Jsi_IncrRefCount(interp, vpargs);
jrc = Jsi_FunctionInvoke(interp, cmd, vpargs, &retStr, NULL);
Jsi_DecrRefCount(interp, vpargs);
if (Jsi_InterpGone(interp))
return JSI_ERROR;
Jsi_DString dStr = {};
const char *rstr = "";
if (jrc != JSI_OK)
rstr = "Error";
else if (Jsi_ValueIsFalse(interp, retStr)) {
rstr = "Access denied";
jrc = JSI_ERROR;
} else
rstr = Jsi_ValueString(interp, retStr, NULL);
if (rstr && tStr && Jsi_Strncmp(rstr, "!!!", 3)==0) {
Jsi_DSAppend(tStr, rstr+3, NULL);
jrc = JSI_CONTINUE;
} else if (rstr && tStr && Jsi_Strncmp(rstr, ">>>", 3)==0) {
Jsi_DSAppend(tStr, rstr+3, NULL);
jrc = JSI_SIGNAL;
} else if (rstr && rstr[0] != 0)
jsi_wsServeString(pss, wsi, rstr, jrc==JSI_OK?0:404, NULL, NULL);
else
jrc = JSI_BREAK;
Jsi_DecrRefCount(interp, retStr);
Jsi_DSFree(&dStr);
return jrc;
} | 201,767,429,892,722,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,712 | 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_FuncSigsMatch(jsi_Pstate *pstate, Jsi_Func *f1, Jsi_Func *f2)
{
// Skip where both functions have no types.
if (f1->retType==0 && f1->argnames->typeCnt==0 && f1->argnames->varargs==0 &&
f2->retType==0 && f2->argnames->typeCnt==0 && f2->argnames->varargs==0 &&
pstate->interp->typeCheck.all==0)
return 1;
if (f1->retType != f2->retType)
return 0;
if (f1->argnames->count != f2->argnames->count)
return 0;
if (f1->argnames->typeCnt != f2->argnames->typeCnt)
return 0;
if (f1->argnames->varargs != f2->argnames->varargs)
return 0;
int i;
for (i=0; i<f1->argnames->count; i++) {
Jsi_ScopeStrs *a1 = f1->argnames, *a2 = f2->argnames;
if (a1->args[i].type != a2->args[i].type)
return 0;
Jsi_Value *v1, *v2;
v1 = a1->args[i].defValue;
v2 = a2->args[i].defValue;
if (v1==NULL && v2 == NULL)
continue;
if (v1==NULL || v2 == NULL)
return 0;
if (v1->vt != v2->vt)
return 0;
if (Jsi_ValueCmp(pstate->interp, v1, v2, 0))
return 0;
}
return 1;
} | 98,345,152,638,192,080,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,713 | 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_wswebsocketObjFree(Jsi_Interp *interp, void *data)
{
jsi_wsCmdObj *cmdPtr = (jsi_wsCmdObj*)data;
WSSIGASSERT(cmdPtr,OBJ);
cmdPtr->deleted = 1;
struct lws_context *ctx = cmdPtr->context;
if (ctx)
lws_context_destroy(ctx);
cmdPtr->context = NULL;
cmdPtr->_->activeCnt--;
jsi_wswebsocketObjErase(cmdPtr);
_JSI_MEMCLEAR(cmdPtr);
Jsi_Free(cmdPtr);
return JSI_OK;
} | 332,101,431,205,124,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,714 | 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_debug(jsi_Pstate *p, jsi_Pline *line) { JSI_NEW_CODESLN(0,OP_DEBUG, 0); } | 331,818,813,817,555,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,715 | 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_AliasInvoke(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
AliasCmd *ac = (AliasCmd *)funcPtr->cmdSpec->reserved[2];
Jsi_Interp *dinterp = ac->dinterp;
Jsi_Value *nargs = NULL;
int inc=0, argc = Jsi_ValueGetLength(interp, args);
if (!ac) {
Jsi_LogBug("BAD ALIAS INVOKE OF DELETED");
return JSI_ERROR;
}
SIGASSERT(ac,ALIASCMD);
bool isthrd = (interp != dinterp && interp->threadId != dinterp->threadId);
Jsi_Value *nrPtr = Jsi_ValueNew1(dinterp);
if (argc == 0 && ac->args)
nargs = ac->args;
else if (argc) {
if (dinterp == interp)
Jsi_ValueCopy(interp, nrPtr, args);
else if (Jsi_CleanValue(interp, dinterp, args, &nrPtr) != JSI_OK)
return JSI_ERROR;
if (ac->args && Jsi_ValueGetLength(dinterp, ac->args)) {
nargs = Jsi_ValueArrayConcat(dinterp, ac->args, nrPtr);
Jsi_IncrRefCount(dinterp, nargs);
inc=1;
} else {
nargs = nrPtr;
}
}
if (isthrd) {
/* Post to thread event in sub-interps queue. */
if (Jsi_MutexLock(interp, dinterp->QMutex) != JSI_OK)
return JSI_ERROR;
/* Is an async call. */
InterpStrEvent *se, *s = (InterpStrEvent *)Jsi_Calloc(1, sizeof(*s));
// TODO: is s->data inited?
Jsi_DSInit(&s->data);
Jsi_ValueGetDString(interp, nargs, &s->data, JSI_OUTPUT_JSON);
if (inc)
Jsi_DecrRefCount(dinterp, nargs);
Jsi_DecrRefCount(dinterp, nrPtr);
s->acfunc = ac->func;
Jsi_IncrRefCount(dinterp, ac->func);
se = dinterp->interpStrEvents;
if (!se)
dinterp->interpStrEvents = s;
else {
while (se->next)
se = se->next;
se->next = s;
}
Jsi_MutexUnlock(interp, dinterp->QMutex);
return JSI_OK;
}
if (dinterp != interp) {
if (interp->subOpts.mutexUnlock) Jsi_MutexUnlock(interp, interp->Mutex);
if (Jsi_MutexLock(interp, dinterp->Mutex) != JSI_OK) {
if (interp->subOpts.mutexUnlock) Jsi_MutexLock(interp, interp->Mutex);
return JSI_ERROR;
}
}
ac->refCount++;
Jsi_Value *srPtr, **srpPtr = ret;
if (dinterp != interp) {
srPtr = Jsi_ValueNew1(dinterp);
srpPtr = &srPtr;
}
Jsi_RC rc = Jsi_FunctionInvoke(dinterp, ac->func, nargs, srpPtr, NULL);
ac->refCount--;
if (inc)
Jsi_DecrRefCount(dinterp, nargs);
Jsi_DecrRefCount(dinterp, nrPtr);
if (dinterp != interp) {
Jsi_MutexUnlock(interp, dinterp->Mutex);
if (interp->subOpts.mutexUnlock && Jsi_MutexLock(interp, interp->Mutex) != JSI_OK) {
return JSI_ERROR;
}
}
if (dinterp != interp) {
Jsi_CleanValue(dinterp, interp, *srpPtr, ret);
Jsi_DecrRefCount(dinterp, srPtr);
if (rc != JSI_OK && dinterp->errMsgBuf[0] && interp != dinterp) {
Jsi_Strcpy(interp->errMsgBuf, dinterp->errMsgBuf);
interp->errLine = dinterp->errLine;
interp->errFile = dinterp->errFile;
dinterp->errMsgBuf[0] = 0;
}
}
return rc;
} | 255,050,525,277,499,950,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 |