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,214
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 MySqlErrorStateCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { MySqlObj *jdb; if (!(jdb = _mysql_getDbHandle(interp, _this, funcPtr))) return JSI_ERROR; const char *str = mysql_sqlstate(jdb->db); if (str) Jsi_ValueMakeStringDup(interp, ret, str); return JSI_OK; }
204,517,318,904,381,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,215
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_Channel jsi_FSOpenProc(Jsi_Interp *interp, Jsi_Value *file, const char *modeString) { return Jsi_Open(interp, file, modeString); }
119,292,501,091,939,460,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,216
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 jsi_wsAddStdHeader(Jsi_Interp *interp, jsi_wsCmdObj *cmdPtr, struct lws *wsi, Jsi_DString *hStr) { uchar buffer[JSI_BUFSIZ]; uchar *p = (unsigned char *)buffer, *end = p + sizeof(buffer); const char *srv = cmdPtr->server; if (!srv) srv = "jsiWebSocket"; int n = 0; if (srv[0] && lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_SERVER, (uchar*)srv, Jsi_Strlen(srv), &p, end)) return false; n = p - buffer; if (n>0) { Jsi_DSAppendLen(hStr, (char*)buffer, n); p = buffer; } return true; }
287,217,345,759,107,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,217
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 regExpFree(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *ptr) { Jsi_RegExpFree((Jsi_Regex*)ptr); return JSI_OK; }
254,395,708,213,448,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,218
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_ThisDataGet(Jsi_Interp *interp, Jsi_Value *_this) { Jsi_HashEntry *hPtr; hPtr = Jsi_HashEntryFind(interp->thisTbl, _this); if (!hPtr) return NULL; return Jsi_HashValueGet(hPtr); }
232,976,401,331,311,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,219
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 dbSetupCallbacks(Jsi_Db *jdb, Jsi_Db *ojdb) { if (jdb->onAuth && (!ojdb || !ojdb->onAuth) ) sqlite3_set_authorizer(jdb->db, dbAuthCallback, jdb); else sqlite3_set_authorizer(jdb->db, 0, 0); if (jdb->onCommit && (!ojdb || !ojdb->onCommit) ) sqlite3_commit_hook(jdb->db, dbCommitHandler, jdb); else sqlite3_commit_hook(jdb->db, 0, 0); if (jdb->onBusy && (!ojdb || !ojdb->onBusy) ) sqlite3_busy_handler(jdb->db, dbBusyHandler, jdb); else sqlite3_busy_handler(jdb->db, 0, 0); if (jdb->onTrace && (!ojdb || !ojdb->onTrace) ) sqlite3_trace(jdb->db, dbTraceHandler, jdb); else sqlite3_trace(jdb->db, 0, 0); if (jdb->onNeedCollate && (!ojdb || !ojdb->onNeedCollate) ) sqlite3_collation_needed(jdb->db, jdb, dbCollateNeeded); else sqlite3_collation_needed(jdb->db, 0, 0); if (jdb->onUpdate && (!ojdb || !ojdb->onUpdate) ) sqlite3_update_hook(jdb->db, dbUpdateHandler, jdb); else sqlite3_update_hook(jdb->db, 0, 0); if (jdb->onWalHook && (!ojdb || !ojdb->onWalHook) ) sqlite3_wal_hook(jdb->db, dbWalHandler, jdb); else sqlite3_wal_hook(jdb->db, 0, 0); if (jdb->onRollback && (!ojdb || !ojdb->onRollback) ) sqlite3_rollback_hook(jdb->db, dbRollbackHandler, jdb); else sqlite3_rollback_hook(jdb->db, 0, 0); if (jdb->onProfile && (!ojdb || !ojdb->onProfile) ) sqlite3_profile(jdb->db, dbProfileHandler, jdb); else sqlite3_profile(jdb->db, 0, 0); if (jdb->onProgress && jdb->progressSteps && (!ojdb || !ojdb->onProgress || ojdb->progressSteps != jdb->progressSteps) ) sqlite3_progress_handler(jdb->db, jdb->progressSteps, dbProgressHandler, jdb); else sqlite3_progress_handler(jdb->db, 0, 0, 0); if (!ojdb || jdb->load != ojdb->load) sqlite3_enable_load_extension(jdb->db, jdb->load); if (!ojdb || jdb->timeout != ojdb->timeout) sqlite3_busy_timeout( jdb->db, jdb->timeout ); /* if (jdb->onUnlock && (!ojdb || !ojdb->onUnlock) ) sqlite3_unlock_notify(jdb->db, dbUnlockNotify, (void*)jdb); else sqlite3_unlock_notify(jdb->db, 0, 0); */ }
15,250,344,108,615,572,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,220
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_band() { JSI_NEW_CODES(0,OP_BAND, 0); }
102,594,909,480,155,070,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,221
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_OptionsCustomPrint(void* clientData, Jsi_Interp *interp, const char *name, void *rec, int offset) { char *record = (char*)rec; Jsi_Value *valuePtr; valuePtr = *(Jsi_Value **)(record + offset); return valuePtr; }
234,502,562,017,788,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,222
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_Db* Jsi_DbNew(const char *zFile, int inFlags /* JSI_DBI_* */) { char *zErrMsg; int flags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; #ifdef SQLITE_JSI_DEFAULT_FULLMUTEX flags |= SQLITE_OPEN_FULLMUTEX; #else flags |= SQLITE_OPEN_NOMUTEX; #endif if (!zFile) zFile = ":memory:"; zErrMsg = 0; Jsi_Db *db = (Jsi_Db*)Jsi_Calloc(1, sizeof(*db) ); if( db==0 ) { JSI_DBQUERY_PRINTF( "malloc failed\n"); return NULL; } db->sig = SQLITE_SIG_DB; db->stmtCacheMax = NUM_PREPARED_STMTS; db->optPtr = &db->queryOpts; if (inFlags&JSI_DBI_READONLY) { flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE); flags |= SQLITE_OPEN_READONLY; } else { flags &= ~SQLITE_OPEN_READONLY; flags |= SQLITE_OPEN_READWRITE; if (inFlags&JSI_DBI_NOCREATE) { flags &= ~SQLITE_OPEN_CREATE; } } if(inFlags&JSI_DBI_NO_MUTEX) { flags |= SQLITE_OPEN_NOMUTEX; flags &= ~SQLITE_OPEN_FULLMUTEX; } else { flags &= ~SQLITE_OPEN_NOMUTEX; } if(inFlags&JSI_DBI_FULL_MUTEX) { flags |= SQLITE_OPEN_FULLMUTEX; flags &= ~SQLITE_OPEN_NOMUTEX; } else { flags &= ~SQLITE_OPEN_FULLMUTEX; } char cpath[PATH_MAX]; char *npath = Jsi_FileRealpathStr(NULL, zFile, cpath); if (SQLITE_OK != sqlite3_open_v2(npath, &db->db, flags, NULL)) { JSI_DBQUERY_PRINTF( "db open failed: %s\n", npath); goto bail; } //Jsi_DSFree(&translatedFilename); if( SQLITE_OK!=sqlite3_errcode(db->db) ) { zErrMsg = sqlite3_mprintf("%s", sqlite3_errmsg(db->db)); DbClose(db->db); db->db = 0; } if( db->db==0 ) { JSI_DBQUERY_PRINTF( "Db open failed %s\n", zErrMsg); sqlite3_free(zErrMsg); goto bail; } db->stmtHash = Jsi_HashNew(NULL, JSI_KEYS_STRING, NULL); db->strKeyTbl = Jsi_HashNew(NULL, JSI_KEYS_STRING, NULL); db->stmtCache = Jsi_ListNew((Jsi_Interp*)db, 0, dbStmtFreeProc); return db; bail: return NULL; }
205,245,986,761,643,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,223
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_ValueIsTrue(Jsi_Interp *interp, Jsi_Value *v) { switch(v->vt) { case JSI_VT_UNDEF: case JSI_VT_NULL: return 0; case JSI_VT_BOOL: return v->d.val ? 1:0; case JSI_VT_NUMBER: if (v->d.num == 0.0 || Jsi_NumberIsNaN(v->d.num)) return 0; return 1; case JSI_VT_STRING: return (Jsi_ValueStrlen(v)!=0); case JSI_VT_OBJECT: { Jsi_Obj *o = v->d.obj; if (o->ot == JSI_OT_STRING) return (Jsi_ValueStrlen(v)!=0); if (o->ot == JSI_OT_NUMBER) return (o->d.num != 0); if (o->ot == JSI_OT_BOOL) return (o->d.val != 0); if (o->ot == JSI_OT_USEROBJ && o->d.uobj->interp == interp) { return jsi_UserObjIsTrue(interp, o->d.uobj); } return 1; } default: Jsi_LogBug("TOP is type incorrect: %d", v->vt); } return 0; }
126,315,644,692,859,090,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,224
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_efinal(jsi_Pstate *p, jsi_Pline *line) { JSI_NEW_CODESLN(0,OP_EFINAL, 0); }
15,378,827,243,533,502,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,225
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 WebSocketIdsCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { jsi_wsCmdObj *cmdPtr = (jsi_wsCmdObj*)Jsi_UserObjGetData(interp, _this, funcPtr); if (!cmdPtr) return Jsi_LogError("Apply in a non-websock object"); const char *val = Jsi_ValueArrayIndexToStr(interp, args, 0, NULL); Jsi_DString dStr = {"["}; jsi_wsPss *pss = NULL; Jsi_HashEntry *hPtr; Jsi_HashSearch cursor; int cnt = 0; for (hPtr = Jsi_HashSearchFirst(cmdPtr->pssTable, &cursor); hPtr != NULL; hPtr = Jsi_HashSearchNext(&cursor)) { pss = (jsi_wsPss*)Jsi_HashValueGet(hPtr); WSSIGASSERT(pss, PWS); if (pss->state == PWS_DEAD) continue; if (val && Jsi_Strcmp(pss->key, val)) continue; Jsi_DSPrintf(&dStr, "%s%d", (cnt++?",":""), pss->wid); if (val) break; } Jsi_DSAppend(&dStr, "]", NULL); Jsi_RC rc = Jsi_JSONParse(interp, Jsi_DSValue(&dStr), ret, 0); Jsi_DSFree(&dStr); return rc; }
127,228,571,005,808,400,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,226
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_ScopeStrsGet(Jsi_ScopeStrs *ss, int i) { if (i < 0 || i >= ss->count) return NULL; return ss->args[i].name; }
301,075,251,903,923,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,227
jsish
430ea27accd4d4ffddc946c9402e7c9064835a18
https://github.com/pcmacdon/jsish
https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18
Release "3.0.7": Fix toPrecision bug "stack overflow #4". FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de
0
static void delete_one_child(Jsi_TreeEntry*n) { Jsi_TreeEntry *child; Assert(n->left == NULL || n->right == NULL); child = n->right == NULL ? n->left : n->right; #if 1 if (node_color(n) == _JSI_TREE_BLACK) { set_color(n, node_color(child)); delete_case1(n); } replace_node(n, child); if (n->parent == NULL && child != NULL) set_color(child, _JSI_TREE_BLACK); #else replace_node(n, child); if (node_color(n) == _JSI_TREE_BLACK) { if (node_color(child) == _JSI_TREE_RED) child->f.bits.color = _JSI_TREE_BLACK; else delete_case1(n); } #endif }
109,548,655,433,080,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,228
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 StringToUpperCaseCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { int sLen, bLen; const char *vstr; ChkString(_this, funcPtr, vstr, &sLen, &bLen); Jsi_DString dStr; Jsi_DSInit(&dStr); jsi_utf_tocase(vstr, 1, &dStr); Jsi_ValueFromDS(interp, &dStr, ret); return JSI_OK; }
28,765,122,430,406,183,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,229
jsish
430ea27accd4d4ffddc946c9402e7c9064835a18
https://github.com/pcmacdon/jsish
https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18
Release "3.0.7": Fix toPrecision bug "stack overflow #4". FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de
0
char *Jsi_FileRealpathStr(Jsi_Interp *interp, const char *path, char *newname) { if (!path || !path[0]) return NULL; Jsi_DString dStr, eStr; char *npath = (char*)path, *apath; Jsi_DSInit(&dStr); Jsi_DSInit(&eStr); if (*path == '~') { #ifndef __WIN32 struct passwd pw, *pwp; /* TODO: could fallback to using env HOME. */ char buf[JSI_BUFSIZ]; int n = getpwuid_r(getuid(), &pw, buf, sizeof(buf), &pwp); const char *homedir = (n == 0 ? pwp->pw_dir : ""); Jsi_DSAppend(&dStr, homedir, path[1] == '/' ? "" : "/", path+1, NULL); #else const char *homedir = getenv("HOMEPATH"); if (!homedir) homedir = "/"; const char *homedrv = getenv("HOMEDRIVE"); if (!homedrv) homedrv = ""; Jsi_DSAppend(&dStr, homedrv, homedir, path[1] == '/' ? "" : "/", path+1, NULL); #endif npath = Jsi_DSValue(&dStr); } #ifdef __WIN32 if (Jsi_Strncmp(path, JSI_ZVFS_DIR, sizeof(JSI_ZVFS_DIR)-1)==0 || Jsi_Strncmp(path, JSI_VFS_DIR, sizeof(JSI_VFS_DIR)-1)==0) apath = NULL; else #endif apath = realpath(npath, newname); if (!apath) { if ((path[0] == '.' && path[1] == '/') || (path[0] != '/' && !(path[0] == '.' && path[1] == '.') && path[1] != ':')) { Jsi_GetCwd(interp, &eStr); Jsi_DSAppend(&eStr, "/", path, NULL); npath = Jsi_DSValue(&eStr); apath = realpath(npath, newname); //npath = (char*)path; } } if (!apath) { if (newname) Jsi_Strcpy(apath=newname, npath); else apath = Jsi_Strdup(npath); #ifndef __WIN32 /* If path not exists on unix we try to eliminate ../ and /./ etc.*/ NormalizeUnixPath(interp, apath); #endif } #ifdef __WIN32 DeBackSlashify(apath); #endif Jsi_DSFree(&dStr); Jsi_DSFree(&eStr); return apath; }
50,616,168,632,236,010,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,230
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 dbBindStmt(Jsi_Db *jdb, SqlPreparedStmt *prep) { sqlite3_stmt *pStmt = prep->pStmt; /* Object used to cache statement */ Jsi_Interp *interp = jdb->interp; int i, btype = 0, bindArr=0, n; Jsi_RC rc = JSI_OK; Jsi_Number r; Jsi_Wide wv; Jsi_Value *pv = NULL, *apv = NULL; int nVar = sqlite3_bind_parameter_count(pStmt); char tname[50]; /* Bind values to parameters that begin with @, $, :, or ? */ for(i=1; i<=nVar; i++) { tname[0] = 0; int isInt = 0, isBlob = 0; const char *zVar = sqlite3_bind_parameter_name(pStmt, i); if (zVar == NULL) { if (!jdb->optPtr || !(apv=jdb->optPtr->values)) return Jsi_LogError("? bind without values for param %d", i); if (!(pv =Jsi_ValueArrayIndex(interp, apv, i-1))) return Jsi_LogError("array element %d missing", nVar); } else if((zVar[0]=='$' || zVar[0]==':' || zVar[0]=='@') ) { int zvLen = Jsi_Strlen(zVar); char *zcp; if (zVar[0] =='$' && ((zcp = (char*)Jsi_Strchr(zVar,'('))) && zVar[zvLen-1] == ')') { bindArr = 1; Jsi_DString vStr; Jsi_DSInit(&vStr); Jsi_DSAppendLen(&vStr, zVar+1, (zcp-zVar-1)); int slen = Jsi_Strlen(zcp); const char *ttp; if ((ttp = Jsi_Strchr(zVar,':'))) { // Extract bind-type. Jsi_DString tStr = {}; int tlen = Jsi_Strlen(ttp+1); Jsi_DSAppendLen(&tStr, ttp+1, tlen-1); if (!jdb->typeNameHash) dbTypeNameHashInit(jdb); Jsi_HashEntry *htPtr = Jsi_HashEntryFind(jdb->typeNameHash, Jsi_DSValue(&tStr)); int rc = ( htPtr != NULL); if (!htPtr) { Jsi_DString eStr = {}; Jsi_HashSearch search; Jsi_Interp *interp = jdb->interp; int n = 0; Jsi_HashEntry *hPtr; for (hPtr = Jsi_HashSearchFirst(jdb->typeNameHash, &search); hPtr != NULL; hPtr = Jsi_HashSearchNext(&search)) { const char *key = (char*)Jsi_HashKeyGet(hPtr); Jsi_DSAppend(&eStr, (n++?", ":""), key, NULL); } Jsi_LogWarn("bind type \"%s\" is not one of: %s", Jsi_DSValue(&tStr), Jsi_DSValue(&eStr)); Jsi_DSFree(&eStr); } Jsi_Strcpy(tname, Jsi_DSValue(&tStr)); Jsi_DSFree(&tStr); if (!rc) return JSI_ERROR; btype = (uintptr_t)Jsi_HashValueGet(htPtr); Jsi_DSFree(&tStr); slen -= tlen; } if (isdigit(zcp[1])) { Jsi_DSAppendLen(&vStr, "[", 1); Jsi_DSAppendLen(&vStr, zcp+1, slen-2); Jsi_DSAppendLen(&vStr, "]", 1); } else { if (zcp[1] != '[') Jsi_DSAppendLen(&vStr, ".", 1); Jsi_DSAppendLen(&vStr, zcp+1, slen-2); } pv = Jsi_NameLookup(interp, Jsi_DSValue(&vStr)); Jsi_DSFree(&vStr); } else pv = Jsi_VarLookup(interp, &zVar[1]); } else return Jsi_LogError("can not find bind var %s", zVar); if(!pv ) { if (!jdb->bindWarn) { Jsi_LogError("unknown bind param: %s", zVar); rc = JSI_ERROR; break; } else Jsi_LogWarn("unknown bind param: %s", zVar); } else { int match = 1, cast = (jdb->optPtr->typeCheck==dbTypeCheck_Cast); if (btype && !Jsi_ValueIsUndef(interp, pv)) { switch (btype) { case JSI_OPTION_STRBUF: isBlob = 1; case JSI_OPTION_STRING: if (cast) Jsi_ValueToString(interp, pv, &n); else match = Jsi_ValueIsString(interp, pv); break; case JSI_OPTION_NUMBER: case JSI_OPTION_DOUBLE: if (cast) Jsi_ValueToNumber(interp, pv); else match = Jsi_ValueIsNumber(interp, pv); break; case JSI_OPTION_TIME_W: case JSI_OPTION_TIME_T: case JSI_OPTION_INT64: isInt = 1; if (cast) Jsi_ValueToNumber(interp, pv); else match = Jsi_ValueIsNumber(interp, pv); break; case JSI_OPTION_BOOL: if (cast) Jsi_ValueToBool(interp, pv); else match = Jsi_ValueIsNumber(interp, pv); break; case JSI_OPTION_TIME_D: if (cast) Jsi_ValueToNumber(interp, pv); //TODO: do something more for dates? else match = Jsi_ValueIsNumber(interp, pv); break; default: Jsi_LogBug("Unhandled bind type: %s = %d", tname, btype); } if (cast == 0 && match == 0) { int ltyp = (jdb->optPtr->typeCheck==dbTypeCheck_Error?JSI_LOG_ERROR:JSI_LOG_WARN); Jsi_LogMsg(interp, ltyp, "bind param \"%s\" type is not \"%s\"", zVar, tname); if (ltyp == JSI_LOG_ERROR) return JSI_ERROR; } } bool bn, isArr; const char *dectyp; if (Jsi_ValueIsBoolean(interp, pv)) { Jsi_GetBoolFromValue(interp, pv, &bn); sqlite3_bind_int(pStmt, i, bn); } else if (Jsi_ValueIsNumber(interp, pv)) { Jsi_GetNumberFromValue(interp, pv, &r); wv = (Jsi_Wide)r; if (isInt || (jdb->forceInt && (((Jsi_Number)wv)-r)==0)) sqlite3_bind_int64(pStmt, i,wv); else sqlite3_bind_double(pStmt, i,(double)r); } else if (Jsi_ValueIsNull(interp, pv) || (Jsi_ValueIsUndef(interp, pv) && jdb->queryOpts.mapundef)) { sqlite3_bind_null(pStmt, i); } else if (Jsi_ValueIsString(interp, pv)) { const char *sstr = Jsi_ValueGetStringLen(interp, pv, &n); if (!sstr) sstr = ""; if (isBlob) sqlite3_bind_blob(pStmt, i, (char *)sstr, n, SQLITE_TRANSIENT ); else sqlite3_bind_text(pStmt, i, (char *)sstr, n, SQLITE_TRANSIENT ); } else if (!jdb->noJsonConv && bindArr && ((isArr=Jsi_ValueIsArray(interp, pv)) || Jsi_ValueIsObjType(interp, pv, JSI_OT_OBJECT)) && (((dectyp = sqlite3_column_decltype(pStmt, i))==NULL) || !Jsi_Strncasecmp(dectyp,"charjson",8))) { // Limitation: on INSERT can not access decltype. Jsi_DString jStr = {}; Jsi_ValueGetDString(interp, pv, &jStr, JSI_OUTPUT_JSON|JSI_JSON_STRICT); n = Jsi_DSLength(&jStr); sqlite3_bind_text(pStmt, i, Jsi_DSValue(&jStr), n, SQLITE_TRANSIENT ); Jsi_DSFree(&jStr); } else { if (!jdb->bindWarn) { Jsi_LogError("bind param must be string/number/bool/null: %s", zVar); rc = JSI_ERROR; break; } else Jsi_LogWarn("bind param must be string/number/bool/null: %s", zVar); sqlite3_bind_null(pStmt, i); } } } return rc; }
280,919,757,995,195,330,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,231
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 sqliteObjErase(Jsi_Db *jdb) { dbDeleteCmd(jdb); jdb->db = NULL; }
75,985,452,708,409,110,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,232
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 freeFuncsTbl(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *ptr) { Jsi_Func *func = (Jsi_Func *)ptr; if (!func) return JSI_OK; SIGASSERT(func,FUNC); func->hPtr = NULL; jsi_FuncFree(interp, func); return JSI_OK; }
318,258,317,599,056,020,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,233
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_OBJCHK(Jsi_Obj *obj) { SIGASSERTV(obj,OBJ); assert(obj->ot <= JSI_OT__MAX); }
85,795,249,530,487,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,234
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 *opassign(jsi_Pstate *pstate, jsi_Pline *line, Jsi_OpCodes *lval, Jsi_OpCodes *oprand, Jsi_OpCodes *op) { Jsi_OpCodes *ret; if ((lval)->lvalue_flag == 1) { ret = codes_join3(lval, codes_join3(code_push_top(), oprand, op), code_assign(pstate, line, 1)); } else { ret = codes_join3(lval, codes_join4(code_push_top2(), code_subscript(pstate, line, 1), oprand, op), code_assign(pstate, line, 2)); } return ret; }
240,100,895,713,728,130,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,235
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_StructSpec* dbLookupSpecFromName(Jsi_StructSpec *specs, const char *name) { Jsi_StructSpec *specPtr = NULL; for (specPtr = specs; specPtr->id>=JSI_OPTION_BOOL && specPtr->id < JSI_OPTION_END; specPtr++) { if (specPtr->flags&JSI_OPT_DB_IGNORE) continue; const char *cname = specPtr->name; if (cname[0] == name[0] && !Jsi_Strncasecmp(cname, name, -1)) return specPtr; } return NULL; }
179,508,619,117,223,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,236
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_MapValueSet(Jsi_MapEntry *h, const void *value){ switch (jsi_GetListType(h)) { case JSI_MAP_HASH: return Jsi_HashValueSet((Jsi_HashEntry*)h, (void*)value); case JSI_MAP_TREE: return Jsi_TreeValueSet((Jsi_TreeEntry*)h, (void*)value); case JSI_MAP_LIST: return Jsi_ListValueSet((Jsi_ListEntry*)h, (void*)value); case JSI_MAP_NONE: break; } }
221,786,733,967,981,100,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,237
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 JsiCheckConversion(const char *str, const char *endptr) { if (str[0] == '\0' || str == endptr) { return JSI_ERROR; } if (endptr[0] != '\0') { while (*endptr) { if (!isspace(UCHAR(*endptr))) { return JSI_ERROR; } endptr++; } } return JSI_OK; }
187,799,467,102,614,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,238
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_ValueNewBoolean(Jsi_Interp *interp, int bval) { Jsi_Value *v = Jsi_ValueNew(interp); v->vt = JSI_VT_BOOL; v->d.val = bval; return v; }
21,651,757,651,481,836,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,239
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 MutexUnlock(Jsi_Mutex *mtx) { pthread_mutex_unlock(&mtx->mtx); }
260,778,246,754,852,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,240
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 DeleteAllInterps() { /* Delete toplevel interps. */ Jsi_HashEntry *hPtr; Jsi_HashSearch search; if (!jsiIntData.interpsTbl) return; for (hPtr = Jsi_HashSearchFirst(jsiIntData.interpsTbl, &search); hPtr; hPtr = Jsi_HashSearchNext(&search)) { Jsi_Interp *interp = (Jsi_Interp *)Jsi_HashKeyGet(hPtr); Jsi_HashEntryDelete(hPtr); interp->destroying = 1; Jsi_InterpDelete(interp); } Jsi_HashDelete(jsiIntData.interpsTbl); jsiIntData.interpsTbl = NULL; jsiIntData.isInit = 0; }
260,844,308,281,014,140,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,241
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_args() { JSI_NEW_CODES(0,OP_PUSHARG, 0); }
317,708,551,049,231,550,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,242
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 Jsi_OptionTypedef* Jsi_OptionTypeInfo(Jsi_OptionId typ) { if (typ>=JSI_OPTION_BOOL && typ < JSI_OPTION_END) return jsi_OptTypeInfo+typ; return NULL; }
177,647,626,216,737,100,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,243
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_ScopeStrs *jsi_ScopeGetVarlist(jsi_Pstate *ps) { Jsi_Interp *interp = ps->interp; return jsi_ScopeStrsDup(ps, interp->scopes[interp->cur_scope]); }
282,866,499,629,351,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,244
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 jsiPopArgs(Jsi_OpCodes *argCodes, int i) { int m=i-1, n = (uintptr_t)argCodes->codes[i].data, cnt = 0; if (argCodes->codes[i].op == OP_OBJECT) n *= 2; for (; m>=0 && cnt<n; m--, cnt++) { int op = argCodes->codes[m].op; if (op == OP_ARRAY || op == OP_OBJECT) m = jsiPopArgs(argCodes, m); } return m+1; }
301,836,640,506,177,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,245
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_FunctionIsConstructor(Jsi_Func *funcPtr) { return (funcPtr->f.bits.iscons); }
24,380,324,508,851,850,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,246
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_bool(int v) { JSI_NEW_CODES(0,OP_PUSHBOO, v); }
121,650,411,723,084,400,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,247
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_HashValueGet(Jsi_HashEntry *h) { return h->clientData; }
103,856,811,049,786,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,248
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_StackPop(Jsi_Stack *stack) { if (stack->len == 0) return NULL; stack->len--; return stack->vector[stack->len]; }
334,251,442,045,786,830,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,249
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_HashKeyGet(Jsi_HashEntry *hPtr) { Jsi_Hash *t = hPtr->tablePtr; return (t->keyType == JSI_KEYS_ONEWORD || t->keyType == JSI_KEYS_STRINGKEY ? hPtr->key.oneWordValue : hPtr->key.string); }
179,379,407,475,997,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,250
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_nop() { JSI_NEW_CODES(0,OP_NOP, 0); }
132,413,233,624,917,670,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,251
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_stry(jsi_Pstate *p, jsi_Pline *line, int trylen, int catchlen, int finlen) { jsi_TryInfo *ti = (jsi_TryInfo *)Jsi_Calloc(1,sizeof(*ti)); ti->trylen = trylen; ti->catchlen = catchlen; ti->finallen = finlen; JSI_NEW_CODESLN(1,OP_STRY, ti); }
75,563,857,784,829,670,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,252
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_InterpThread(Jsi_Interp *interp) { return NULL; }
214,714,406,085,986,120,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,253
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_PstateGetFilename(jsi_Pstate *ps) { Jsi_Interp *interp = ps->interp; return interp->curFile; }
27,703,064,812,257,587,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,254
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_DelAssocData(Jsi_Interp *interp, void *data) { AssocData *ptr = (AssocData *)data; if (!ptr) return; if (ptr->delProc) ptr->delProc(interp, ptr->data); Jsi_Free(ptr); }
263,946,416,260,429,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,255
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 StringFromCharCodeCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { if (_this->vt != JSI_VT_OBJECT || _this->d.obj->ot == JSI_OT_STRING) return Jsi_LogError("should be called via String.fromCharCode"); Jsi_DString dStr = {}; int n, i, len, argc = Jsi_ValueGetLength(interp, args); for (i=0; i<argc; i++) { Jsi_Value *v = Jsi_ValueArrayIndex(interp, args, i); if (!Jsi_ValueIsNumber(interp, v) || Jsi_GetIntFromValue(interp, v, &n) != JSI_OK) { Jsi_DSFree(&dStr); return Jsi_LogError("expected int value at arg %d", i+1); } char dest[5]; len = Jsi_UniCharToUtf((Jsi_UniChar)n, dest); Jsi_DSAppendLen(&dStr, dest, len); } Jsi_ValueMakeDStringObject(interp, ret, &dStr); return JSI_OK; }
187,537,071,766,131,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,256
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_NameLookup(Jsi_Interp *interp, const char *name) { uint cnt = 0, len, isq; char *nam = (char*)name, *cp, *cp2, *ocp, *kstr; //DECL_VALINIT(tv); DECL_VALINIT(nv); DECL_VALINIT(key); Jsi_Value *v = NULL, *nvPtr = &nv; Jsi_Value *kPtr = &key; // Note: a string key so no reset needed. Jsi_DString dStr = {}; cp2 = Jsi_Strchr(nam,'['); cp = Jsi_Strchr(nam, '.'); if (cp2 && (cp==0 || cp2<cp)) cp = cp2; if (!cp) return Jsi_VarLookup(interp, nam); //fprintf(stderr, "NAM: %s\n", nam); Jsi_DSSetLength(&dStr, 0); Jsi_DSAppendLen(&dStr, nam, cp-nam); v = Jsi_VarLookup(interp, Jsi_DSValue(&dStr)); if (!v) goto bail; while (v && cnt++ < 1000) { ocp = cp; nam = cp+1; isq = 0; if (*cp == '[') { cp = FindEndB(cp+1); /* handle [] in strings. */ if (!cp) goto bail; len = cp-nam; cp++; if (len>=2 && ((nam[0] == '\"' && nam[len-1] == '\"') || (nam[0] == '\'' && nam[len-1] == '\''))) { nam += 1; len -= 2; isq = 1; } } else if (*cp == '.') { cp2 = Jsi_Strchr(nam,'['); cp = Jsi_Strchr(nam, '.'); if (cp2 && (cp==0 || cp2<cp)) cp = cp2; len = (cp ? (uint)(cp-nam) : Jsi_Strlen(nam)); } else { goto bail; } Jsi_DSSetLength(&dStr, 0); Jsi_DSAppendLen(&dStr, nam, len); kstr = Jsi_DSValue(&dStr); if (*ocp == '[' && isq == 0 && isdigit(kstr[0]) && Jsi_ValueIsArray(interp, v)) { int nn; if (Jsi_GetInt(interp, kstr, &nn, 0) != JSI_OK) goto bail; v = Jsi_ValueArrayIndex(interp, v, nn); if (!v) goto bail; } else if (*ocp == '[' && isq == 0) { Jsi_Value *kv = Jsi_VarLookup(interp, kstr); if (!kv) goto bail; v = jsi_ValueSubscript(interp, v, kv, &nvPtr); goto keyon; } else { Jsi_ValueMakeStringKey(interp, &kPtr, kstr); v = jsi_ValueSubscript(interp, v, kPtr, &nvPtr); keyon: if (!v) goto bail; } if (cp == 0 || *cp == 0) break; } //Jsi_ValueReset(interp, &ret); Jsi_DSFree(&dStr); if (v && v == nvPtr) { v = Jsi_ValueNew(interp); //Jsi_ValueMove(interp, v, &tv); #ifdef JSI_MEM_DEBUG memcpy(v, &nv, sizeof(nv)-sizeof(nv.VD)); v->VD.label3 = nv.VD.func; if (interp->memDebug>1) v->VD.label2 = Jsi_KeyAdd(interp, name); #else *v = nv; #endif } return v; bail: Jsi_DSFree(&dStr); return NULL; }
22,140,550,271,339,350,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,257
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 dbEvalRowInfo( DbEvalContext *p, /* Evaluation context */ int *pnCol, /* OUT: Number of column names */ char ***papColName, /* OUT: Array of column names */ int **papColType ) { /* Compute column names */ // Jsi_Interp *interp = p->jdb->interp; if( 0==p->apColName ) { sqlite3_stmt *pStmt = p->pPreStmt->pStmt; int i; /* Iterator variable */ int nCol; /* Number of columns returned by pStmt */ char **apColName = 0; /* Array of column names */ int *apColType = 0; const char *zColName; /* Column name */ int numRid = 0; /* Number of times rowid seen. */ p->nCol = nCol = sqlite3_column_count(pStmt); if( nCol>0 && (papColName || p->pArray) ) { int cnLen = sizeof(char*)*nCol, cnStart = cnLen; for(i=0; i<nCol && cnLen<sizeof(p->staticColNames); i++) cnLen += Jsi_Strlen(sqlite3_column_name(pStmt,i))+1; if (cnLen>=sizeof(p->staticColNames)) { apColName = (char**)Jsi_Calloc(nCol, sizeof(char*) ); cnStart = 0; } else { apColName = (char**)p->staticColNames; } if (papColType) { if (nCol < SQL_MAX_STATIC_TYPES) apColType = p->staticColTypes; else apColType = (int*)Jsi_Calloc(nCol, sizeof(int)); } for(i=0; i<nCol; i++) { zColName = sqlite3_column_name(pStmt,i); if (cnStart==0) apColName[i] = Jsi_Strdup(zColName); else { apColName[i] = p->staticColNames+cnStart; Jsi_Strcpy(apColName[i], zColName); cnStart += Jsi_Strlen(zColName)+1; } if (apColType) apColType[i] = sqlite3_column_type(pStmt,i); /* Check if rowid appears first, and more than once. */ if ((i == 0 || numRid>0) && (zColName[0] == 'r' && Jsi_Strcmp(zColName,"rowid") == 0)) { numRid++; } } /* Change first rowid to oid. */ if (numRid > 1) { if (apColName != (char**)p->staticColNames) { Jsi_Free(apColName[0]); apColName[0] = Jsi_Strdup("oid"); } else { Jsi_Strcpy(apColName[0], "oid"); } } p->apColName = apColName; p->apColType = apColType; } } if( papColName ) { *papColName = p->apColName; } if( papColType ) { *papColType = p->apColType; } if( pnCol ) { *pnCol = p->nCol; } }
263,887,886,480,990,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,258
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 Jsi_OptionTypedef* Jsi_OptionsStr2Type(const char *str, bool cName) { int typ; for (typ=JSI_OPTION_BOOL; typ < JSI_OPTION_END; typ++) { const char *snam = (cName?jsi_OptTypeInfo[typ].cName:jsi_OptTypeInfo[typ].idName); if (snam && snam[0] && !Jsi_Strcmp(str, snam)) return jsi_OptTypeInfo+typ; } return NULL; }
221,898,096,478,733,930,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,259
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 dbPrepareStmt( Jsi_Db *jdb, /* Database object */ char const *zIn, /* SQL to compile */ char const **pzOut, /* OUT: Pointer to next SQL statement */ SqlPreparedStmt **ppPreStmt /* OUT: Object used to cache statement */ ) { const char *zSql = zIn; /* Pointer to first SQL statement in zIn */ sqlite3_stmt *pStmt; /* Prepared statement object */ SqlPreparedStmt *pPreStmt = 0; /* Pointer to cached statement */ // int nSql; /* Length of zSql in bytes */ //int nVar; /* Number of variables in statement */ //int iParm = 0; /* Next free entry in apParm */ Jsi_RC rc = JSI_OK; Jsi_Interp *interp = jdb->interp; JSI_NOTUSED(interp); *ppPreStmt = 0; /* Trim spaces from the start of zSql and calculate the remaining length. */ while( isspace(zSql[0]) ) { zSql++; } //nSql = Jsi_Strlen(zSql); Jsi_HashEntry *entry = Jsi_HashEntryFind(jdb->stmtHash, zSql); if (entry && ((pPreStmt = (SqlPreparedStmt*)Jsi_HashValueGet(entry)))) { if (jdb->debug & TMODE_PREPARE) JSI_DBQUERY_PRINTF( "DEBUG: prepare cache-hit: %s\n", zSql); pStmt = pPreStmt->pStmt; *pzOut = &zSql[pPreStmt->nSql]; /* When a prepared statement is found, unlink it from the ** cache list. It will later be added back to the beginning ** of the cache list in order to implement LRU replacement. */ Jsi_ListPop(jdb->stmtCache, pPreStmt->elPtr); jdb->stmtCacheCnt = Jsi_ListSize(jdb->stmtCache); } /* If no prepared statement was found. Compile the SQL text. Also allocate ** a new SqlPreparedStmt structure. */ if( pPreStmt==0 ) { int nByte; if( SQLITE_OK!=sqlite3_prepare_v2(jdb->db, zSql, -1, &pStmt, pzOut) ) return Jsi_LogError("PREPARE: %s", sqlite3_errmsg(jdb->db)); if( pStmt==0 ) { if( SQLITE_OK!=sqlite3_errcode(jdb->db) ) { /* A compile-time error in the statement. */ Jsi_LogError("PREP: %s", sqlite3_errmsg(jdb->db)); return JSI_ERROR; } else { /* The statement was a no-op. Continue to the next statement ** in the SQL string. */ return JSI_OK; } } if (jdb->debug & TMODE_PREPARE) JSI_DBQUERY_PRINTF( "DEBUG: prepare new: %s\n", zSql); assert( pPreStmt==0 ); //nVar = sqlite3_bind_parameter_count(pStmt); jdb->stmtCacheCnt++; nByte = sizeof(SqlPreparedStmt); // + nVar*sizeof(Jsi_Obj *); pPreStmt = (SqlPreparedStmt*)Jsi_Calloc(1, nByte); pPreStmt->sig = SQLITE_SIG_STMT; pPreStmt->pStmt = pStmt; pPreStmt->nSql = (*pzOut - zSql); pPreStmt->zSql = sqlite3_sql(pStmt); bool isNew = 0; pPreStmt->entry = Jsi_HashEntryNew(jdb->stmtHash, zSql, &isNew); if (!isNew) JSI_DBQUERY_PRINTF( "sqlite dup stmt entry"); Jsi_HashValueSet(pPreStmt->entry, pPreStmt); //pPreStmt->apParm = (Jsi_Value **)&pPreStmt[1]; } assert( pPreStmt ); assert( Jsi_Strlen(pPreStmt->zSql)==pPreStmt->nSql ); assert( 0==memcmp(pPreStmt->zSql, zSql, pPreStmt->nSql) ); *ppPreStmt = pPreStmt; //pPreStmt->nParm = iParm; return rc; }
24,625,984,540,343,586,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,260
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_TreeUnset(Jsi_Tree *treePtr, void *key) { Jsi_TreeEntry *hPtr = Jsi_TreeEntryFind(treePtr, key); if (!hPtr) return false; Jsi_TreeEntryDelete(hPtr); return true; }
268,614,818,947,975,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,261
jsish
430ea27accd4d4ffddc946c9402e7c9064835a18
https://github.com/pcmacdon/jsish
https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18
Release "3.0.7": Fix toPrecision bug "stack overflow #4". FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de
0
char* jsi_KeyFind(Jsi_Interp *interp, const char *str, int nocreate, int *isKey) { Jsi_MapEntry *hPtr; if (isKey) *isKey = 0; if (!nocreate) { *isKey = 1; if (isKey) *isKey = 1; return (char*)Jsi_KeyAdd(interp, str); } hPtr = Jsi_MapEntryFind(interp->strKeyTbl, str); if (!hPtr) { return Jsi_Strdup(str);; } if (isKey) *isKey = 1; *isKey = 1; return (char*)Jsi_MapKeyGet(hPtr, 0); }
327,557,696,890,728,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,262
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_FSTruncateProc(Jsi_Channel chan, unsigned int len) { return ftruncate(fileno(_JSI_GETFP(chan,1)), len);}
268,386,555,801,327,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,263
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 SplitChar(const char *str, int *argcPtr, char ***argvPtr, char ch, Jsi_DString *dStr) { char *cp, *ep, *p, **argv; int cnt = 1, len, i; len = Jsi_Strlen(str); cp = (char*)str; while (*cp) { if (ch) cp = Jsi_Strchr(cp,ch); else { while (*cp && !isspace(*cp)) cp++; } if (cp == NULL || *cp == 0) break; cp++; cnt++; } //argv = (char**)Jsi_Calloc(1,(sizeof(char*)*(cnt+3) + sizeof(char)*(len+6))); Jsi_DSSetLength(dStr, (sizeof(char*)*(cnt+3) + sizeof(char)*(len+6))); argv = (char**)Jsi_DSValue(dStr); *argvPtr = argv; *argcPtr = cnt; p = (char*)&(argv[cnt+2]); argv[cnt+1] = p; Jsi_Strcpy(p, str); cp = p; i = 0; argv[i++] = p; while (*cp) { if (ch) ep = Jsi_Strchr(cp,ch); else { ep = cp; while (*ep && !isspace(*ep)) ep++; } if (ep == NULL || *ep == 0) break; *ep = 0; cp = ep+1; argv[i++] = cp; } argv[cnt] = NULL; }
229,485,805,373,660,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,264
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_ValueDupJSON(Jsi_Interp *interp, Jsi_Value *val) { Jsi_DString pStr; Jsi_DSInit(&pStr); Jsi_ValueGetDString(interp, val, &pStr, JSI_OUTPUT_JSON); Jsi_Value *valPtr = NULL; if (Jsi_JSONParse(interp, Jsi_DSValue(&pStr), &valPtr, 0) != JSI_OK) Jsi_LogBug("bad json parse"); Jsi_DSFree(&pStr); return valPtr; }
216,129,946,600,304,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,265
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_wscallback_websock(struct lws *wsi, enum lws_callback_reasons reason, void *user, void *in, size_t len) { struct lws_context *context = lws_get_context(wsi); jsi_wsPss *pss = NULL; jsi_wsCmdObj *cmdPtr = (jsi_wsCmdObj *)lws_context_user(context); if (!cmdPtr) { fprintf(stderr, "null ws context\n"); return -1; } Jsi_Interp *interp = cmdPtr->interp; char *inPtr = (char*)in; int sLen, n, rc =0; WSSIGASSERT(cmdPtr, OBJ); if (Jsi_InterpGone(interp)) cmdPtr->deleted = 1; if (cmdPtr->debug>=32) { switch (reason) { case LWS_CALLBACK_SERVER_WRITEABLE: case LWS_CALLBACK_CLIENT_WRITEABLE: break; default: fprintf(stderr, "WS CALLBACK: len=%d, %p %d:%s\n", (int)len, user, reason, jsw_getReasonStr(reason)); } } switch (reason) { case LWS_CALLBACK_PROTOCOL_INIT: if (cmdPtr->noWebsock) return 1; break; case LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION: pss = jsi_wsgetPss(cmdPtr, wsi, user, 1, 1); Jsi_DSSet(&pss->url, inPtr); if (cmdPtr->instCtx == context && (cmdPtr->clientName[0] || cmdPtr->clientIP[0])) { pss->clientName = cmdPtr->clientName; pss->clientIP = cmdPtr->clientIP; } if (cmdPtr->onFilter && !cmdPtr->deleted) { if (!pss) pss = jsi_wsgetPss(cmdPtr, wsi, user, 1, 0); int killcon = 0, n = 0; Jsi_Obj *oarg1; Jsi_Value *vpargs, *vargs[10], *ret = Jsi_ValueNew1(interp); vargs[n++] = Jsi_ValueNewObj(interp, cmdPtr->fobj); vargs[n++] = Jsi_ValueNewNumber(interp, (Jsi_Number)(pss->wid)); vargs[n++] = Jsi_ValueNewBlob(interp, (uchar*)in, len); vargs[n++] = Jsi_ValueNewBoolean(interp, 0); vpargs = Jsi_ValueMakeObject(interp, NULL, oarg1 = Jsi_ObjNewArray(interp, vargs, n, 0)); Jsi_IncrRefCount(interp, vpargs); Jsi_ValueMakeUndef(interp, &ret); rc = Jsi_FunctionInvoke(interp, cmdPtr->onFilter, vpargs, &ret, NULL); if (rc == JSI_OK && Jsi_ValueIsFalse(interp, ret)) { if (cmdPtr->debug>1) fprintf(stderr, "WS:KILLING CONNECTION: %p\n", user); killcon = 1; } Jsi_DecrRefCount(interp, vpargs); Jsi_DecrRefCount(interp, ret); if (rc != JSI_OK) { Jsi_LogError("websock bad rcv eval"); return 1; } if (killcon) return 1; } break; case LWS_CALLBACK_CLIENT_ESTABLISHED: case LWS_CALLBACK_ESTABLISHED: if (cmdPtr->bufferPwr2>0) { char nbuf[JSI_MAX_NUMBER_STRING]; snprintf(nbuf, sizeof(nbuf), "%d", cmdPtr->bufferPwr2); lws_set_extension_option(wsi, "permessage-deflate", "rx_buf_size", nbuf); lws_set_extension_option(wsi, "permessage-deflate", "tx_buf_size", nbuf); } if (!pss) pss = jsi_wsgetPss(cmdPtr, wsi, user, 1, 0); if (cmdPtr->onOpen && !cmdPtr->deleted) { /* Pass 2 args: ws id. */ Jsi_Obj *oarg1; Jsi_Value *vpargs, *vargs[10]; int n = 0; vargs[n++] = Jsi_ValueNewObj(interp, cmdPtr->fobj); vargs[n++] = Jsi_ValueNewNumber(interp, (Jsi_Number)(pss->wid)); vpargs = Jsi_ValueMakeObject(interp, NULL, oarg1 = Jsi_ObjNewArray(interp, vargs, n, 0)); Jsi_IncrRefCount(interp, vpargs); Jsi_Value *ret = Jsi_ValueNew1(interp); Jsi_ValueMakeUndef(interp, &ret); rc = Jsi_FunctionInvoke(interp, cmdPtr->onOpen, vpargs, &ret, NULL); Jsi_DecrRefCount(interp, vpargs); Jsi_DecrRefCount(interp, ret); if (rc != JSI_OK) return Jsi_LogError("websock bad rcv eval"); } break; case LWS_CALLBACK_WSI_DESTROY: break; case LWS_CALLBACK_CLOSED: case LWS_CALLBACK_PROTOCOL_DESTROY: pss = jsi_wsgetPss(cmdPtr, wsi, user, 0, 0); if (!pss) break; if (cmdPtr->onClose || pss->onClose) { rc = jsi_wsrecv_callback(interp, cmdPtr, pss, inPtr, len, 1); if (rc != JSI_OK) return Jsi_LogError("websock bad rcv eval"); } jsi_wsdeletePss(pss); if (cmdPtr->stats.connectCnt<=0 && cmdPtr->onCloseLast && !Jsi_InterpGone(interp)) { Jsi_RC jrc; Jsi_Value *retStr = Jsi_ValueNew1(interp); // 1 args: ws Jsi_Value *vpargs, *vargs[10]; int n = 0; vargs[n++] = (cmdPtr->deleted?Jsi_ValueNewNull(interp):Jsi_ValueNewObj(interp, cmdPtr->fobj)); vpargs = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, vargs, n, 0)); Jsi_IncrRefCount(interp, vpargs); jrc = Jsi_FunctionInvoke(interp, cmdPtr->onCloseLast, vpargs, &retStr, NULL); Jsi_DecrRefCount(interp, vpargs); Jsi_DecrRefCount(interp, retStr); if (Jsi_InterpGone(interp)) return JSI_ERROR; return jrc; } break; case LWS_CALLBACK_CLIENT_WRITEABLE: case LWS_CALLBACK_SERVER_WRITEABLE: { pss = jsi_wsgetPss(cmdPtr, wsi, user, 0, 0); if (!pss || !pss->stack) break; if (pss->lastData) Jsi_Free(pss->lastData); n=0; char *data = pss->lastData = (char*)Jsi_StackUnshift(pss->stack); unsigned char *p; if (data == NULL) break; pss->stats.msgQLen--; pss->state = PWS_SENT; p = (unsigned char *)data+LWS_PRE; sLen = Jsi_Strlen((char*)p); n = jsi_wswrite(pss, wsi, p, sLen, (pss->stats.isBinary?LWS_WRITE_BINARY:LWS_WRITE_TEXT)); if (cmdPtr->debug>=10) fprintf(stderr, "WS:CLIENT WRITE(%p): %d=>%d\n", pss, sLen, n); if (n >= 0) { cmdPtr->stats.sentCnt++; cmdPtr->stats.sentLast = time(NULL); pss->stats.sentCnt++; pss->stats.sentLast = time(NULL); } else { lwsl_err("ERROR %d writing to socket\n", n); pss->state = PWS_SENDERR; pss->stats.sentErrCnt++; pss->stats.sentErrLast = time(NULL); cmdPtr->stats.sentErrCnt++; cmdPtr->stats.sentErrLast = time(NULL); rc = 1; } break; } case LWS_CALLBACK_CLIENT_RECEIVE: case LWS_CALLBACK_RECEIVE: { pss = jsi_wsgetPss(cmdPtr, wsi, user, 0, 0); if (!pss) break; pss->stats.recvCnt++; pss->stats.recvLast = time(NULL); cmdPtr->stats.recvCnt++; cmdPtr->stats.recvLast = time(NULL); if (cmdPtr->onRecv || pss->onRecv) { /* Pass 2 args: id and data. */ int nlen = len; if (nlen<=0) return 0; int rblen = Jsi_DSLength(&pss->recvBuf), bmax = cmdPtr->recvBufMax, isfin = pss->stats.isFinal = lws_is_final_fragment(wsi); pss->stats.isBinary = lws_frame_is_binary(wsi); if (rblen) { if (bmax && rblen>bmax) { fprintf(stderr, "WS: Recv exceeds recvBufMax: %d>%d\n", rblen, bmax); rc = 1; break; } Jsi_DSAppendLen(&pss->recvBuf, inPtr, len); if (!isfin) break; cmdPtr->recvBufCnt--; nlen = Jsi_DSLength(&pss->recvBuf); inPtr = Jsi_DSFreeDup(&pss->recvBuf); } else { if (!isfin) { cmdPtr->recvBufCnt++; Jsi_DSAppendLen(&pss->recvBuf, inPtr, len); break; } } rc = jsi_wsrecv_callback(interp, cmdPtr, pss, inPtr, nlen, 0); if (inPtr != in) Jsi_Free(inPtr); if (rc != JSI_OK) { Jsi_LogError("websock bad rcv eval"); return 1; } } lws_callback_on_writable_all_protocol(cmdPtr->context, lws_get_protocol(wsi)); break; } default: break; } return rc; }
13,073,460,542,672,724,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,266
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_TreeValueGet(Jsi_TreeEntry *hPtr) { return hPtr->value; }
332,210,931,707,508,670,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,267
jsish
430ea27accd4d4ffddc946c9402e7c9064835a18
https://github.com/pcmacdon/jsish
https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18
Release "3.0.7": Fix toPrecision bug "stack overflow #4". FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de
0
static Jsi_RC jsi_wsrecv_callback(Jsi_Interp *interp, jsi_wsCmdObj *cmdPtr, jsi_wsPss *pss, const char *inPtr, int nlen, bool isClose) { Jsi_Value *vpargs, *vargs[10]; Jsi_Value* func = NULL; if (Jsi_InterpGone(interp) || (cmdPtr->deleted && !isClose)) return JSI_ERROR; int n = 0; if (isClose) func = ((pss && pss->onClose)?pss->onClose:cmdPtr->onClose); else func = ((pss && pss->onRecv)?pss->onRecv:cmdPtr->onRecv); if (!func) return JSI_OK; vargs[n++] = (cmdPtr->deleted?Jsi_ValueNewNull(interp):Jsi_ValueNewObj(interp, cmdPtr->fobj)); vargs[n++] = Jsi_ValueNewNumber(interp, (Jsi_Number)(pss?pss->wid:0)); if (!isClose) { if (nlen<=0) return JSI_OK; vargs[n++] = Jsi_ValueNewBlob(interp, (uchar*)inPtr, nlen); if ((cmdPtr->echo||(pss && pss->echo)) && inPtr) Jsi_LogInfo("WS-RECV: %s\n", inPtr); } vpargs = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, vargs, n, 0)); Jsi_IncrRefCount(interp, vpargs); Jsi_Value *ret = Jsi_ValueNew1(interp); Jsi_RC rc = Jsi_FunctionInvoke(interp, func, vpargs, &ret, NULL); if (rc == JSI_OK && Jsi_ValueIsUndef(interp, ret)==0 && !isClose) { /* TODO: should we handle callback return data??? */ } Jsi_DecrRefCount(interp, vpargs); Jsi_DecrRefCount(interp, ret); return rc; }
111,420,755,474,573,100,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,268
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 MySqlConstructor(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { MySqlObj *jdb; Jsi_Value *arg = Jsi_ValueArrayIndex(interp, args, 0); Jsi_LogTest("Creating new MySql"); jdb = (MySqlObj*)Jsi_Calloc(1, sizeof(*jdb)); SQLSIGINIT(jdb, DB); const char *groupname = "mysqljsi"; jdb->_ = &mydbObjCmd; jdb->_->newCnt++; jdb->_->activeCnt++; jdb->maxStmts = NUM_PREPARED_STMTS; jdb->forceInt = 1; jdb->interp = interp; jdb->hasOpts = (arg != NULL && !Jsi_ValueIsNull(interp,arg)); if (jdb->hasOpts && Jsi_OptionsProcess(interp, SqlOptions, jdb, arg, 0) < 0) { jdb->deleted = 1; mysqlObjFree(interp, jdb); return JSI_ERROR; } if (!jdb->udata) { jdb->udata = Jsi_ValueNewObj(interp, NULL); Jsi_IncrRefCount(interp, jdb->udata); } jdb->db = mysql_init(NULL); jdb->version = (MYSQL_VERSION_MAJOR + ((Jsi_Number)MYSQL_VERSION_MINOR/100.0) + ((Jsi_Number)MYSQL_VERSION_PATCH/10000.0)); #if (MYSQL_VERSION_ID>=32350) if (jdb->reconnect) { my_bool reconnect = 1; mysql_options(jdb->db, MYSQL_OPT_RECONNECT, &reconnect); } mysql_options(jdb->db, MYSQL_READ_DEFAULT_GROUP, groupname); #endif #if (MYSQL_VERSION_ID >= 40107) if (jdb->sslKey) { const char *sslcert = Jsi_ValueString(interp, jdb->sslCert, NULL), *sslca = Jsi_ValueString(interp, jdb->sslCA, NULL), *sslcapath = Jsi_ValueString(interp, jdb->sslCAPath, NULL), *sslcipher = Jsi_ValueString(interp, jdb->sslCipher, NULL), *sslkey = Jsi_ValueString(interp, jdb->sslKey, NULL); mysql_ssl_set(jdb->db, sslkey, sslcert, sslca, sslcapath, sslcipher); jdb->dbflags |= CLIENT_SSL; } #endif if (!mdbConnect(interp, jdb)) { Jsi_LogError("connect failed %s", mysql_error(jdb->db)); mysqlObjFree(interp, jdb); return JSI_ERROR; } if (jdb->enableMulti) { if (mysql_set_server_option(jdb->db, MYSQL_OPTION_MULTI_STATEMENTS_ON)) Jsi_LogWarn("multi on failed %s", mysql_error(jdb->db)); } //jdb->event = Jsi_EventNew(interp, mysqlUpdate, jdb); //TODO: events Jsi_Value *toacc = NULL; if (Jsi_FunctionIsConstructor(funcPtr)) { toacc = _this; } else { Jsi_Obj *o = Jsi_ObjNew(interp); Jsi_PrototypeObjSet(interp, "MySql", o); Jsi_ValueMakeObject(interp, ret, o); toacc = *ret; } Jsi_Obj *fobj = Jsi_ValueGetObj(interp, toacc); if ((jdb->objId = Jsi_UserObjNew(interp, &mysqlobject, fobj, jdb))<0) { mysqlObjFree(interp, jdb); Jsi_ValueMakeUndef(interp, ret); return JSI_ERROR; } jdb->stmtHash = Jsi_HashNew(interp, JSI_KEYS_STRING, NULL); jdb->userObjPtr = fobj; jdb->optPtr = &jdb->queryOpts; jdb->stmtCache = Jsi_ListNew((Jsi_Interp*)jdb, 0, mdbStmtFreeProc); return JSI_OK; }
322,016,127,255,621,400,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,269
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_evalSubscript(Jsi_Interp *interp, Jsi_Value *src, Jsi_Value *idx, jsi_OpCode *ip, jsi_OpCode *end, Jsi_Value *currentScope) { Jsi_RC rc = JSI_OK; jsiVarDeref(interp,2); int isnull; if ((isnull=Jsi_ValueIsNull(interp, src)) || Jsi_ValueIsUndef(interp, src)) { Jsi_LogError("invalid subscript of %s", (isnull?"null":"undefined")); jsiPop(interp, 1); return JSI_ERROR; } Jsi_String *str = jsi_ValueString(src); if (str && Jsi_ValueIsNumber(interp, idx)) { int bLen, cLen; char bbuf[10], *cp = Jsi_ValueString(interp, src, &bLen); int n = (int)idx->d.num; cLen = bLen; #if JSI__UTF8 if (str->flags&JSI_IS_UTF || !(str->flags&JSI_UTF_CHECKED)) { cLen = Jsi_NumUtfChars(cp, bLen); str->flags |= JSI_UTF_CHECKED; if (cLen != bLen) str->flags |= JSI_IS_UTF; } #endif if (n<0 || n>=cLen) { Jsi_ValueMakeUndef(interp, &src); } else { if (cLen != bLen) Jsi_UtfGetIndex(cp, n, bbuf); else { bbuf[0] = cp[n]; bbuf[1] = 0; } Jsi_ValueMakeStringDup(interp, &src, bbuf); } jsiPop(interp, 1); return rc; } Jsi_ValueToObject(interp, src); if (interp->hasCallee && (src->d.obj == currentScope->d.obj || (interp->framePtr->arguments && src->d.obj == interp->framePtr->arguments->d.obj))) { if (idx->vt == JSI_VT_STRING && Jsi_Strcmp(idx->d.s.str, "callee") == 0) { jsiClearStack(interp,1); Jsi_ValueMakeStringKey(interp, &idx, "\1callee\1"); } } int bsc = Jsi_ValueIsObjType(interp, src, JSI_OT_NUMBER); // Previous bad subscript. if (bsc == 0 && interp->lastSubscriptFail && interp->lastSubscriptFail->vt != JSI_VT_UNDEF) Jsi_ValueReset(interp, &interp->lastSubscriptFail); if (src->vt != JSI_VT_UNDEF) { int right_val = (uintptr_t)ip->data; Jsi_Value res = VALINIT, *resPtr = &res, *vp = jsi_ValueSubscript(interp, src, idx, &resPtr); if (!vp && bsc == 0) { /* eg. so we can list available commands for "db.xx()" */ if (idx->vt == JSI_VT_STRING) interp->lastSubscriptFailStr = idx->d.s.str; Jsi_ValueDup2(interp, &interp->lastSubscriptFail, src); } if (vp) Jsi_IncrRefCount(interp, vp); jsiClearStack(interp,2); if (!vp) Jsi_ValueMakeUndef(interp, &src); else { //printf("IDX(%p): %s\n", idx, Jsi_ValueString(interp, idx, NULL)); if (right_val || vp->f.bits.readonly) { if (vp == resPtr && (res.vt == JSI_VT_OBJECT || res.vt == JSI_VT_STRING)) // TODO:*** Undo using ValueCopy. *** Jsi_ValueMove(interp, src, vp); else Jsi_ValueCopy(interp, src, vp); } else { assert(vp != resPtr); res.vt = JSI_VT_VARIABLE; res.d.lval = vp; Jsi_ValueCopy(interp, src, resPtr); } Jsi_DecrRefCount(interp, vp); } } jsiPop(interp, 1); return rc; }
178,304,132,373,518,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,270
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 interpObjEqual(void *data1, void *data2) { return (data1 == data2); }
27,861,121,753,221,865,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,271
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_code_decode(Jsi_Interp *interp, jsi_OpCode *op, int currentip, char *buf, int bsiz) { if (_JSICASTINT(op->op) < 0 || op->op >= OP_LASTOP) { snprintf(buf, bsiz, "Bad opcode[%d] at %d", op->op, currentip); } char nbuf[JSI_MAX_NUMBER_STRING]; snprintf(nbuf, sizeof(nbuf), "%d#%d", currentip, op->Line); snprintf(buf, bsiz, "%-8s %s ", nbuf, jsi_op_names[op->op]); int sl = Jsi_Strlen(buf); char *bp = buf + sl; bsiz -= sl; if (op->op == OP_PUSHBOO || op->op == OP_FCALL || op->op == OP_EVAL || op->op == OP_POP || op->op == OP_ASSIGN || op->op == OP_RET || op->op == OP_NEWFCALL || op->op == OP_DELETE || op->op == OP_CHTHIS || op->op == OP_OBJECT || op->op == OP_ARRAY || op->op == OP_SHF || op->op == OP_INC || op->op == OP_DEC) snprintf(bp, bsiz, "%" PRId64, (Jsi_Wide)(uintptr_t)op->data); else if (op->op == OP_PUSHNUM) Jsi_NumberDtoA(interp, *((Jsi_Number *)op->data), bp, bsiz, 0); else if (op->op == OP_PUSHVSTR) { Jsi_String *ss = (Jsi_String*)op->data; snprintf(bp, bsiz, "\"%s\"", ss->str); } else if (op->op == OP_PUSHSTR || op->op == OP_LOCAL || op->op == OP_SCATCH) snprintf(bp, bsiz, "\"%s\"", op->data ? (char*)op->data:"(NoCatch)"); else if (op->op == OP_PUSHVAR) snprintf(bp, bsiz, "var: \"%s\"", ((jsi_FastVar *)op->data)->varname); else if (op->op == OP_PUSHFUN) snprintf(bp, bsiz, "func: 0x%" PRIx64, (Jsi_Wide)(uintptr_t)op->data); else if (op->op == OP_JTRUE || op->op == OP_JFALSE || op->op == OP_JTRUE_NP || op->op == OP_JFALSE_NP || op->op == OP_JMP) snprintf(bp, bsiz, "{%" PRIu64 "}\t#%" PRIu64 "", (Jsi_Wide)(uintptr_t)op->data, (Jsi_Wide)((uintptr_t)currentip + (uintptr_t)op->data)); else if (op->op == OP_JMPPOP) { jsi_JmpPopInfo *jp = (jsi_JmpPopInfo*)op->data; snprintf(bp, bsiz, "{%d},%d\t#%d", jp->off, jp->topop, currentip + jp->off); } else if (op->op == OP_STRY) { jsi_TryInfo *t = (jsi_TryInfo *)op->data; snprintf(bp, bsiz, "{try:%d, catch:%d, final:%d}", t->trylen, t->catchlen, t->finallen); } }
214,319,828,151,435,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,272
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_Truncate(Jsi_Interp *interp, Jsi_Channel chan, unsigned int len) { if (chan->fsPtr==0 || !chan->fsPtr->truncateProc) return -1; return chan->fsPtr->truncateProc(chan, len); }
75,377,033,169,227,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,273
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 FilesysEofCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { UdfGet(udf, _this, funcPtr); Jsi_ValueMakeBool(interp, ret, Jsi_Eof(interp, udf->chan)); return JSI_OK; }
13,893,785,136,628,377,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,274
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_FuncArgCheck(Jsi_Interp *interp, Jsi_Func *f, const char *argStr) { int i, atyp, ftyp, rc = 0, acnt; Jsi_DString dStr; Jsi_DSInit(&dStr); int argc = 0; char **argv, *sname, *stype, *cp; if (!argStr) goto done; if (f->type == FC_BUILDIN) { // Check builtin cmd jsi_CommandArgCheck(interp, f->cmdSpec, f, f->parentName); goto done; } if ((cp=Jsi_Strchr(argStr, '='))) { Jsi_LogWarn("may not have default value in option, expected: %s", argStr); goto done; } if (Jsi_Strstr(argStr, "...")) { Jsi_LogWarn("may not have ... in args, expected: %s", argStr); goto done; } if (argStr[0]) { Jsi_SplitStr(argStr, &argc, &argv, ",", &dStr); if (argc<=0) goto done; } if (!f->argnames) { if (argStr[0]) Jsi_LogWarn("function has no args, expected: %s", argStr); else rc = 1; goto done; } else { if (f->argnames->varargs) { // TODO: could allow varargs... if (argc < f->argnames->argCnt) { Jsi_LogWarn("vararg argument mismatch, expected: %s", argStr); goto done; } } else if (f->argnames->argCnt != argc) { if (argc) Jsi_LogWarn("argument mismatch, expected: %s", argStr); else Jsi_LogWarn("function should have no arguments"); goto done; } } acnt = f->argnames->argCnt; for (i=0; i<argc && i<acnt; i++) { sname = argv[i]; stype = NULL; while (sname && *sname && isspace(*sname)) { sname++; } if ((cp=Jsi_Strchr(sname, ':'))) { stype = cp+1; *cp = 0; while (*stype && isspace(*stype)) { stype++; } if (*stype) { cp = stype+Jsi_Strlen(stype)-1; while (cp>=stype && isspace(*cp)) { *cp = 0; cp--; } } } if (sname && *sname) { cp = sname+Jsi_Strlen(sname)-1; while (cp>=sname && isspace(*cp)) { *cp = 0; cp--; } } ftyp = f->argnames->args[i].type; if (ftyp<=0 || (ftyp&JSI_TT_ANY)) continue; atyp = jsi_typeGet(interp, stype); if (ftyp != atyp && atyp) { Jsi_LogWarn("argument %d of function \"%s\" does not match \"func(%s)\"" , i+1, f->name, argStr); goto done; } } rc = 1; done: Jsi_DSFree(&dStr); if (!rc) jsi_TypeMismatch(interp); return rc; }
193,197,860,265,526,670,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,275
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 freeValueTbl(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *ptr) { Jsi_Value *val = (Jsi_Value *)ptr; if (!val) return JSI_OK; SIGASSERT(val,VALUE); //printf("GEN: %p\n", val); /* if (val->refCnt>1) Jsi_DecrRefCount(interp, val);*/ Jsi_DecrRefCount(interp, val); return JSI_OK; }
206,555,388,444,456,640,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,276
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 freeUserdataTbl(Jsi_Interp *interp, Jsi_HashEntry *hPtr, void *ptr) { if (ptr) jsi_UserObjDelete(interp, ptr); return JSI_OK; }
312,661,786,038,285,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,277
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_BuiltinCmd(Jsi_Interp *interp, const char *name) { Jsi_Value *val = Jsi_NameLookup(interp, name); if (!name) return 0; if (!Jsi_ValueIsFunction(interp, val)) return 0; Jsi_Func *f = val->d.obj->d.fobj->func; return (f->type == FC_BUILDIN); }
133,023,079,638,717,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,278
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_PstateFree(jsi_Pstate *ps) { /* TODO: when do we free opcodes */ jsi_PstateClear(ps); Jsi_Free(ps->lexer); if (ps->opcodes) jsi_FreeOpcodes(ps->opcodes); if (ps->hPtr) Jsi_HashEntryDelete(ps->hPtr); if (ps->argsTbl) Jsi_HashDelete(ps->argsTbl); if (ps->fastVarTbl) Jsi_HashDelete(ps->fastVarTbl); if (ps->strTbl) Jsi_HashDelete(ps->strTbl); if (ps->last_exception) Jsi_DecrRefCount(ps->interp, ps->last_exception); _JSI_MEMCLEAR(ps); Jsi_Free(ps); }
192,004,409,298,074,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,279
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 mdbOutputQuotedString(Jsi_DString *dStr, const char *z) { int i; int nSingle = 0; for(i=0; z[i]; i++) { if( z[i]=='\'' ) nSingle++; } if( nSingle==0 ) { Jsi_DSAppend(dStr,"'", z, "'", NULL); } else { Jsi_DSAppend(dStr,"'", NULL); while( *z ) { for(i=0; z[i] && z[i]!='\''; i++) {} if( i==0 ) { Jsi_DSAppend(dStr,"''", NULL); z++; } else if( z[i]=='\'' ) { Jsi_DSAppendLen(dStr,z, i); Jsi_DSAppend(dStr,"''", NULL); z += i+1; } else { Jsi_DSAppend(dStr, z, NULL); break; } } Jsi_DSAppend(dStr,"'", NULL); } }
69,069,215,752,581,190,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,280
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 StringSubstringCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { int sLen = 0, bLen; const char *v; ChkString(_this, funcPtr, v, &sLen, &bLen); Jsi_Value *start = Jsi_ValueArrayIndex(interp, args, skip); Jsi_Value *end = Jsi_ValueArrayIndex(interp, args, skip+1); Jsi_Number nstart, nend; if (!start || Jsi_GetNumberFromValue(interp,start, &nstart) != JSI_OK) { Jsi_ValueMakeStringDup(interp, ret, v); return JSI_OK; } int istart = (int)nstart, olen = -1; Jsi_DString dStr; Jsi_DSInit(&dStr); char *ostr; if (!end || Jsi_GetNumberFromValue(interp,end, &nend) != JSI_OK) { if (sLen == bLen) { ostr = jsi_SubstrDup(v, bLen, istart, -1, &olen); Jsi_ValueMakeBlob(interp, ret, (uchar*)ostr, olen); } else { Jsi_UtfSubstr(v, istart, -1, &dStr); Jsi_ValueFromDS(interp, &dStr, ret); } return JSI_OK; } int iend = (int)nend; if (iend>sLen) iend = sLen; if (iend < istart) { Jsi_ValueMakeStringDup(interp, ret, ""); } else { if (sLen == bLen) { ostr = jsi_SubstrDup(v, bLen, istart, iend-istart+1, &olen); Jsi_ValueMakeBlob(interp, ret, (uchar*)ostr, olen); } else { Jsi_UtfSubstr(v, istart, iend-istart+1, &dStr); Jsi_ValueFromDS(interp, &dStr, ret); } } return JSI_OK; }
297,130,096,265,207,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,281
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_ecatch(jsi_Pstate *p, jsi_Pline *line) { JSI_NEW_CODESLN(0,OP_ECATCH, 0); }
77,930,595,663,285,990,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,282
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_NumberIsSubnormal(Jsi_Number a) { return fpclassify(a) == FP_SUBNORMAL; }
308,731,039,516,737,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,283
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_Link(Jsi_Interp *interp, Jsi_Value* src, Jsi_Value *dest, int typ) { void *data; Jsi_Filesystem *fsPtr = Jsi_FilesystemForPath(interp, src, &data); if (fsPtr == NULL || !fsPtr->linkProc) return -1; return fsPtr->linkProc(interp, src, dest, typ); }
102,903,754,329,940,120,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,284
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_NumberUtoA10(Jsi_UWide value, char* buf, int bsiz) { snprintf(buf, bsiz, "%" PRIu64, value); }
29,658,406,587,938,590,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,285
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_throw(jsi_Pstate *p, jsi_Pline *line) { JSI_NEW_CODESLN(0,OP_THROW, 0); }
321,972,582,402,571,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,286
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_sfinal(jsi_Pstate *p, jsi_Pline *line) { JSI_NEW_CODESLN(0,OP_SFINAL, 0); }
6,243,234,481,660,880,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,287
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_pop_try(Jsi_Interp* interp, jsi_TryList **head) { interp->framePtr->tryDepth--; jsi_TryList *t = (*head)->next; Jsi_Free(*head); *head = t; interp->tryList = t; }
112,396,562,012,989,370,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,288
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_hashFmtKey(Jsi_MapEntry* h, struct Jsi_MapOpts *opts, int flags) { Jsi_HashEntry* hPtr = (Jsi_HashEntry*)h; void *key = Jsi_HashKeyGet(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); }
14,182,381,365,516,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,289
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_FSNative(Jsi_Interp *interp, Jsi_Value *file) { void *data; Jsi_Filesystem *fsPtr = Jsi_FilesystemForPath(interp, file, &data); if (fsPtr && fsPtr == &jsiFilesystem) return 1; else return 0; }
53,228,711,017,354,860,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,290
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_CmdSpec *Jsi_FunctionGetSpecs(Jsi_Func *funcPtr) { return funcPtr->cmdSpec; }
200,395,827,768,032,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,291
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 sqliteObjFree(Jsi_Interp *interp, void *data) { Jsi_Db *db = (Jsi_Db*)data; SQLSIGASSERT(db,DB); db->_->activeCnt--; sqliteObjErase(db); _JSI_MEMCLEAR(db); Jsi_Free(db); return JSI_OK; }
146,627,606,749,109,530,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,292
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_ValueTypeStr(Jsi_Interp *interp, Jsi_Value *v) { switch (v->vt) { case JSI_VT_BOOL: return "boolean"; break; case JSI_VT_UNDEF: return "undefined"; break; case JSI_VT_NULL: return "null"; break; case JSI_VT_NUMBER: return "number"; break; case JSI_VT_STRING: return "string"; break; case JSI_VT_VARIABLE: return "variable"; break; case JSI_VT_OBJECT: return Jsi_ObjTypeStr(interp, v->d.obj); } return ""; }
137,896,795,984,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,293
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 mysqlObjErase(MySqlObj *jdb) { mdbDeleteCmd(jdb); jdb->db = NULL; }
244,648,404,665,443,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,294
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_HashSearchNext(Jsi_HashSearch *searchPtr) { Jsi_HashEntry *hPtr; Jsi_Hash *tablePtr = searchPtr->tablePtr; int locked = 0; while (searchPtr->nextEntryPtr == NULL) { if (searchPtr->nextIndex >= (size_t)tablePtr->numBuckets) { if (tablePtr->opts.lockHashProc && locked) (*tablePtr->opts.lockHashProc)(tablePtr, 0); return NULL; } if (tablePtr->opts.lockHashProc && locked == 0 && (*tablePtr->opts.lockHashProc)(tablePtr, locked++) != JSI_OK) return NULL; searchPtr->nextEntryPtr = tablePtr->buckets[searchPtr->nextIndex]; searchPtr->nextIndex++; } if (tablePtr->opts.lockHashProc && locked) (*tablePtr->opts.lockHashProc)(tablePtr, 0); hPtr = searchPtr->nextEntryPtr; searchPtr->nextEntryPtr = hPtr->nextPtr; return hPtr; }
270,438,663,717,233,880,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,295
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 mdbPrepareAndBind(MyDbEvalContext *p) { if (mdbPrepareStmt(p) != JSI_OK) return JSI_ERROR; MysqlPrep *prep = p->prep; MySqlObj *jdb = p->jdb; Jsi_Interp *interp = jdb->interp; Jsi_Value *pv = NULL, *apv = NULL; char tname[50]; Jsi_RC rc = JSI_OK; int i, n, nVar = prep->numParam; if (nVar<=0) return rc; if (!prep->bindParam) prep->bindParam = (MYSQL_BIND*)Jsi_Calloc(nVar, sizeof(MYSQL_BIND)); else memset(prep->bindParam, 0, (nVar * sizeof(MYSQL_BIND))); for(i=1; i<=nVar; i++) { int btype = 0; int isInt = 0; int isBlob = 0; const char *zVar = mysqlGetbindParamName(prep, i); tname[0] = 0; if (zVar == NULL) { if (!jdb->optPtr || !(apv=jdb->optPtr->values)) return Jsi_LogError("? bind without values for param %d", i); if (!(pv =Jsi_ValueArrayIndex(interp, apv, i-1))) return Jsi_LogError("array element %d missing", nVar); } else if ((zVar[0]!='$' && zVar[0]!=':' && zVar[0]!='@') ) return Jsi_LogError("can not find bind var %s", zVar); else { int zvLen = Jsi_Strlen(zVar); char *zcp; if (zVar[0] =='$' && ((zcp = Jsi_Strchr(zVar,'('))) && zVar[zvLen-1] == ')') { Jsi_DString vStr; Jsi_DSInit(&vStr); Jsi_DSAppendLen(&vStr, zVar+1, (zcp-zVar-1)); int slen = Jsi_Strlen(zcp); const char *ttp; if (jdb->optPtr->typeCheck!=mdbTypeCheck_None && (ttp = Jsi_Strchr(zVar,':'))) { // Extract bind-type. Jsi_DString tStr = {}; int tlen = Jsi_Strlen(ttp+1); Jsi_DSAppendLen(&tStr, ttp+1, tlen-1); snprintf(tname, sizeof(tname), "%s", Jsi_DSValue(&tStr)); Jsi_HashEntry *hPtr = Jsi_HashEntryFind(jdb->typeNameHash, tname); assert(hPtr); btype = (long)Jsi_HashValueGet(hPtr); Jsi_DSFree(&tStr); slen -= tlen; } if (isdigit(zcp[1])) { Jsi_DSAppendLen(&vStr, "[", 1); Jsi_DSAppendLen(&vStr, zcp+1, slen-2); Jsi_DSAppendLen(&vStr, "]", 1); } else { if (zcp[1] != '[') Jsi_DSAppendLen(&vStr, ".", 1); Jsi_DSAppendLen(&vStr, zcp+1, slen-2); } pv = Jsi_NameLookup(interp, Jsi_DSValue(&vStr)); Jsi_DSFree(&vStr); } else pv = Jsi_VarLookup(interp, &zVar[1]); } Jsi_Number r; SqlFieldResults *fres = prep->fieldParam+i-1; MYSQL_BIND *bind = prep->bindParam+i-1; memset(bind, 0, sizeof(*bind)); // Now create binding. if(!pv ) { if (!jdb->bindWarn) { rc = Jsi_LogError("unknown bind param: %s", zVar); break; } else Jsi_LogWarn("unknown bind param: %s", zVar); } else { if (btype && !Jsi_ValueIsUndef(interp, pv)) { int done = 0, match = 1, cast = (jdb->optPtr->typeCheck==mdbTypeCheck_Cast); switch (btype) { case MYSQL_TYPE_BLOB: isBlob = 1; case MYSQL_TYPE_STRING: if (cast) Jsi_ValueToString(interp, pv, &n); else match = Jsi_ValueIsString(interp, pv); break; case MYSQL_TYPE_DOUBLE: if (cast) Jsi_ValueToNumber(interp, pv); else match = Jsi_ValueIsNumber(interp, pv); break; case MYSQL_TYPE_LONGLONG: isInt = 1; if (cast) Jsi_ValueToNumber(interp, pv); else match = Jsi_ValueIsNumber(interp, pv); break; case MYSQL_TYPE_TINY: if (cast) Jsi_ValueToBool(interp, pv); else match = Jsi_ValueIsBoolean(interp, pv); break; case MYSQL_TYPE_TIME: case MYSQL_TYPE_DATE: case MYSQL_TYPE_DATETIME: case MYSQL_TYPE_TIMESTAMP: if (cast) Jsi_ValueToNumber(interp, pv); else if (!Jsi_ValueIsNumber(interp, pv)) goto errout; Jsi_GetNumberFromValue(interp, pv, &r); bind->buffer_type = (enum enum_field_types)btype; bind->buffer=&fres->buffer.timestamp; bind->buffer_length = sizeof(fres->buffer.timestamp); bind->length = NULL; mdbJsToMyTime(r, &fres->buffer.timestamp, 1); done = 1; break; default: Jsi_LogBug("Unhandled bind type: %s = %d", tname, btype); } if (done) continue; if (cast == 0 && match == 0) errout: { int ltyp = (jdb->optPtr->typeCheck==mdbTypeCheck_Error?JSI_LOG_ERROR:JSI_LOG_WARN); Jsi_LogMsg(interp, ltyp, "bind param \"%s\" type is not \"%s\"", zVar, tname); if (ltyp == JSI_LOG_ERROR) return JSI_ERROR; } } if (Jsi_ValueIsBoolean(interp, pv)) { bool nb; Jsi_GetBoolFromValue(interp, pv, &nb); n = nb; bind->buffer_type = MYSQL_TYPE_TINY; bind->buffer = &fres->buffer.vchar; bind->buffer_length = sizeof(fres->buffer.vchar); bind->length = &fres->len; //bind->is_null = &fres->isnull; fres->buffer.vchar = n; } else if (Jsi_ValueIsNumber(interp, pv)) { Jsi_Number r; Jsi_Wide wv; Jsi_GetNumberFromValue(interp, pv, &r); wv = (Jsi_Wide)r; bind->buffer_type = MYSQL_TYPE_DOUBLE; bind->buffer = &fres->buffer.vdouble; bind->buffer_length = sizeof(fres->buffer.vdouble); bind->length = &fres->len; fres->buffer.vdouble = (double)r; if (isInt || (jdb->forceInt && (((Jsi_Number)wv)-r)==0)) { bind->buffer = &fres->buffer.vlonglong; bind->buffer_type = MYSQL_TYPE_LONGLONG; bind->buffer_length = sizeof(fres->buffer.vlonglong); fres->buffer.vlonglong = wv; } } else if (Jsi_ValueIsNull(interp, pv) || (Jsi_ValueIsUndef(interp, pv) && jdb->optPtr->mapundef)) { bindnull: bind->buffer_type = MYSQL_TYPE_NULL; bind->buffer = &fres->buffer.vchar; bind->buffer_length = sizeof(fres->buffer.vchar); bind->length = &fres->len; fres->buffer.vchar = 0; } else if (Jsi_ValueIsString(interp, pv)) { char *sstr = Jsi_ValueGetStringLen(interp, pv, &n); bind->buffer_type = MYSQL_TYPE_STRING; bind->buffer=sstr; bind->buffer_length = n; bind->length = NULL; if (isBlob) bind->buffer_type = MYSQL_TYPE_BLOB; } else { if (!jdb->bindWarn) { rc = Jsi_LogError("bind param must be string/number/bool/null: %s", zVar); break; } else { Jsi_LogWarn("bind param must be string/number/bool/null: %s", zVar); goto bindnull; } } } } if (mysql_stmt_bind_param(prep->myStmt, prep->bindParam)) rc = Jsi_LogError("bind failed: %s", mysql_error(jdb->db)); return rc; }
5,336,604,644,704,316,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,296
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 NumberToPrecisionCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { char buf[JSI_MAX_NUMBER_STRING*2]; int prec = 0, skip = 0; Jsi_Number num; Jsi_Value *v; ChkStringN(_this, funcPtr, v); if (Jsi_GetIntFromValue(interp, Jsi_ValueArrayIndex(interp, args, skip), &prec) != JSI_OK) return JSI_ERROR; if (prec<=0 || prec>JSI_MAX_NUMBER_STRING) return Jsi_LogError("precision must be between 1 and %d", JSI_MAX_NUMBER_STRING); Jsi_GetDoubleFromValue(interp, v, &num); snprintf(buf, sizeof(buf),"%.*" JSI_NUMFFMT, prec, num); if (num<0) prec++; buf[prec+1] = 0; if (buf[prec] == '.') buf[prec] = 0; Jsi_ValueMakeStringDup(interp, ret, buf); return JSI_OK; }
176,441,123,893,071,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,297
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 FilesysFlushCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { UdfGet(udf, _this, funcPtr); int pos = Jsi_Flush(interp, udf->chan); Jsi_ValueMakeNumber(interp, ret, (Jsi_Number)pos); return JSI_OK; }
20,720,903,327,948,641,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,298
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_ParentFuncToValue(Jsi_Interp *interp, Jsi_OptionSpec* spec, Jsi_Value **outValue, Jsi_DString *outStr, void *record, Jsi_Wide flags) { if (outStr) return JSI_ERROR; Jsi_Value **v = (Jsi_Value **)(((char*)record) + spec->offset); //const char *s, *subspec = (const char *)spec->data; if (!*v) { Jsi_ValueMakeNull(interp, outValue); return JSI_OK; } if (!interp->parent) return Jsi_LogError("no parent interp"); if (spec->data) { Jsi_DString dStr = {}; Jsi_DSPrintf(&dStr, "func(%s)", (char*)spec->data); Jsi_ValueFromDS(interp, &dStr, outValue); } return JSI_OK; }
207,136,919,265,460,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,299
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 mdbDeleteCmd(MySqlObj *jdb) { Jsi_Interp *interp = jdb->interp; if (jdb->debug & mdbTMODE_DELETE) JSI_DBQUERY_PRINTF( "DEBUG: delete\n"); if (jdb->stmtCache) mdbFlushStmtCache(jdb); if (jdb->stmtHash) Jsi_HashDelete(jdb->stmtHash); //closeIncrblobChannels(jdb); if (jdb->db) { mdbClose(jdb->db); } while( jdb->pFunc ) { SqlFunc *pFunc = jdb->pFunc; jdb->pFunc = pFunc->pNext; Jsi_DSFree(&pFunc->dScript); Jsi_DecrRefCount(interp, pFunc->tocall); Jsi_Free((char*)pFunc); } if( jdb->zNull ) { Jsi_Free(jdb->zNull); } if (jdb->typeNameHash) Jsi_HashDelete(jdb->typeNameHash); Jsi_OptionsFree(interp, SqlOptions, jdb, 0); if (jdb->stmtCache) Jsi_ListDelete(jdb->stmtCache); }
253,661,040,865,423,460,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,300
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 sqliteObjEqual(void *data1, void *data2) { //SQLSIGASSERT(data1,DB); //SQLSIGASSERT(data2,DB); return (data1 == data2); }
4,135,836,897,274,850,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,301
jsish
430ea27accd4d4ffddc946c9402e7c9064835a18
https://github.com/pcmacdon/jsish
https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18
Release "3.0.7": Fix toPrecision bug "stack overflow #4". FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de
0
static void delete_case3(Jsi_TreeEntry* n) { Jsi_TreeEntry* s = sibling(n); if (node_color(n->parent) == _JSI_TREE_BLACK && node_color(s) == _JSI_TREE_BLACK && node_color(s->left) == _JSI_TREE_BLACK && node_color(s->right) == _JSI_TREE_BLACK) { set_color(s, _JSI_TREE_RED); delete_case1(n->parent); } else delete_case4(n); }
310,034,293,028,502,670,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,302
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_jmp(int off) { JSI_NEW_CODES(0,OP_JMP, off); }
23,703,930,954,790,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,303
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_VerifyFree(Jsi_Interp *interp, Jsi_OptionSpec* spec, void *ptr) { Jsi_Value **v = (Jsi_Value**)ptr; if (v && *v) Jsi_DecrRefCount(interp, *v); }
178,884,531,899,821,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,304
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 rotate_left(Jsi_TreeEntry* n) { Jsi_TreeEntry* r; Assert(n); r = n->right; replace_node(n, r); n->right = r->left; if (r->left != NULL) { r->left->parent = n; } r->left = n; n->parent = r; }
228,195,751,520,759,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,305
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_CaseList *caselist_new(jsi_Pstate *pstate, jsi_CaseExprStat *es) { jsi_CaseList *a = (jsi_CaseList*)Jsi_Calloc(1,sizeof(*a)); a->sig = JSI_SIG_CASELIST; a->es = es; a->tail = a; return a; }
261,874,174,171,158,400,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,306
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 mdbEvalInit( Jsi_Interp *interp, MyDbEvalContext *p, /* Pointer to structure to initialize */ MySqlObj *jdb, /* Database handle */ const char* zSql, /* Value containing SQL script */ Jsi_DString *dStr, Jsi_Obj *pArray, /* Name of Jsi array to set (*) element of */ Jsi_Obj *pValVar /* Name element in array for list. */ ) { p->dzSql = dStr; p->zSql = Jsi_DSAppend(p->dzSql, zSql?zSql:"", NULL); p->jdb = jdb; return JSI_OK; }
157,431,196,484,597,400,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,307
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 mdbReleaseStmt( MySqlObj *jdb, MysqlPrep *prep, int discard ) { if( jdb->maxStmts<=0 || discard ) { /* If the cache is turned off, deallocated the statement */ mdbRelease1Stmt(jdb, prep); } else { /* Add the prepared statement to the beginning of the cache list. */ if (!prep->elPtr) prep->elPtr = Jsi_ListPushFrontNew(jdb->stmtCache, prep); else Jsi_ListPushFront(jdb->stmtCache, prep->elPtr); mdbStmtLimit(jdb); } }
334,498,131,378,355,030,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,308
jsish
430ea27accd4d4ffddc946c9402e7c9064835a18
https://github.com/pcmacdon/jsish
https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18
Release "3.0.7": Fix toPrecision bug "stack overflow #4". FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de
0
static void delete_case6(Jsi_TreeEntry* n) { Jsi_TreeEntry* s = sibling(n); set_color(s, node_color(n->parent)); set_color(n->parent, _JSI_TREE_BLACK); if (n == n->parent->left) { Assert (node_color(s->right) == _JSI_TREE_RED); set_color(s->right, _JSI_TREE_BLACK); rotate_left(n->parent); } else { //Assert (node_color(s->left) == _JSI_TREE_RED); set_color(s->left, _JSI_TREE_BLACK); rotate_right(n->parent); } }
28,986,424,408,114,437,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,309
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_delete(int n) { JSI_NEW_CODES(0,OP_DELETE, n); }
195,110,548,004,763,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,310
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_Pstate* jsiNewParser(Jsi_Interp* interp, const char *codeStr, Jsi_Channel fp, int iseval) { bool isNew; Jsi_HashEntry *hPtr = NULL; hPtr = Jsi_HashEntryNew(interp->codeTbl, (void*)codeStr, &isNew); if (!hPtr) return NULL; jsi_Pstate *ps, *topPs; if (isNew==0 && ((ps = (jsi_Pstate *)Jsi_HashValueGet(hPtr)))) { interp->codeCacheHit++; return ps; } ps = jsi_PstateNew(interp); ps->eval_flag = iseval; if (codeStr) jsi_PstateSetString(ps, codeStr); else jsi_PstateSetFile(ps, fp, 1); interp->inParse++; topPs = interp->parsePs; interp->parsePs = ps; yyparse(ps); interp->parsePs = topPs; interp->inParse--; if (ps->err_count) { Jsi_HashEntryDelete(hPtr); jsi_PstateFree(ps); return NULL; } if (isNew) { Jsi_HashValueSet(hPtr, ps); ps->hPtr = hPtr; } return ps; }
311,811,283,930,363,100,000,000,000,000,000,000,000
None
null
[ "CWE-120" ]
CVE-2020-22873
Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code.
https://nvd.nist.gov/vuln/detail/CVE-2020-22873
520,311
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_InterpInfo(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { Jsi_Interp *sinterp = interp; Jsi_DString dStr = {}, cStr = {}; char tbuf[1024]; Jsi_Value *v = Jsi_ValueArrayIndex(interp, args, 0); tbuf[0] = 0; if (v) { InterpObj *udf = NULL; if (v && v->vt == JSI_VT_OBJECT && v->d.obj->ot == JSI_OT_USEROBJ) udf = (InterpObj *)v->d.obj->d.uobj->data; if (udf && udf->subinterp) { SIGASSERT(udf, INTERPOBJ); sinterp = udf->subinterp; } else return Jsi_LogError("unknown interp"); } if (sinterp->subthread) snprintf(tbuf, sizeof(tbuf), ", thread:{errorCnt:%u, evalCnt:%u, msgCnt:%u }", sinterp->threadErrCnt, sinterp->threadEvalCnt, sinterp->threadMsgCnt ); const char *funcstr = sinterp->framePtr->funcName; if (!funcstr) funcstr = ""; int curLine = (sinterp->curIp?sinterp->curIp->Line:0); Jsi_DSPrintf(&dStr, "{curLevel:%d, curLine:%d, curFile:\"%s\", curFunc:\"%s\", hasExited:%d, " "opCnt:%d, isSafe:%s, depth:%d, codeCacheHits: %d, typeMismatchCnt:%d, " "funcCallCnt:%d, cmdCallCnt:%d, includeCnt:%d, includeDepth:%d, pkgReqDepth:%d, " "cwd:\"%s\", lockTimeout: %d, name, \"%s\" %s%s};", sinterp->level, curLine, jsi_GetCurFile(sinterp), funcstr?funcstr:"", sinterp->exited, sinterp->opCnt, sinterp->isSafe?"true":"false", sinterp->interpDepth, sinterp->codeCacheHit, sinterp->typeMismatchCnt, sinterp->funcCallCnt, sinterp->cmdCallCnt, sinterp->includeCnt, sinterp->includeDepth, sinterp->pkgReqDepth, (sinterp->curDir?sinterp->curDir:Jsi_GetCwd(sinterp,&cStr)), sinterp->lockTimeout, sinterp->name?sinterp->name:"", tbuf[0]?",":"", tbuf); Jsi_RC rc = Jsi_JSONParse(interp, Jsi_DSValue(&dStr), ret, 0); if (rc != JSI_OK) puts(Jsi_DSValue(&dStr)); Jsi_DSFree(&dStr); Jsi_DSFree(&cStr); return rc; }
203,221,976,874,765,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
520,312
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 dbEvalFinalize(DbEvalContext *p) { // Jsi_Interp *interp = p->jdb->interp; if( p->pPreStmt ) { sqlite3_reset(p->pPreStmt->pStmt); dbReleaseStmt(p->jdb, p->pPreStmt, p->nocache); p->pPreStmt = 0; } if (p->dSql) Jsi_DSFree(p->dSql); dbReleaseColumnNames(p); }
8,805,101,977,833,046,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,313
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 DebugInfoCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this, Jsi_Value **ret, Jsi_Func *funcPtr) { if (!interp->breakpointHash) { Jsi_ValueMakeArrayObject(interp, ret, NULL); return JSI_OK; } int argc = Jsi_ValueGetLength(interp, args); if (argc == 0) return Jsi_HashKeysDump(interp, interp->breakpointHash, ret, 0); Jsi_Value *val = Jsi_ValueArrayIndex(interp, args, 0); int num; char nbuf[JSI_MAX_NUMBER_STRING]; if (Jsi_GetIntFromValue(interp, val, &num) != JSI_OK) return Jsi_LogError("bad number"); snprintf(nbuf, sizeof(nbuf), "%d", num); Jsi_HashEntry *hPtr = Jsi_HashEntryFind(interp->breakpointHash, nbuf); if (!hPtr) return Jsi_LogError("unknown breakpoint"); jsi_BreakPoint* bp = (jsi_BreakPoint*)Jsi_HashValueGet(hPtr); if (!bp) return JSI_ERROR; Jsi_DString dStr = {}; if (bp->func) Jsi_DSPrintf(&dStr, "{id:%d, type:\"func\", func:\"%s\", hits:%d, enabled:%s, temporary:%s}", bp->id, bp->func, bp->hits, bp->enabled?"true":"false", bp->temp?"true":"false"); else Jsi_DSPrintf(&dStr, "{id:%d, type:\"line\", file:\"%s\", line:%d, hits:%d, enabled:%s}", bp->id, bp->file?bp->file:"", bp->line, bp->hits, bp->enabled?"true":"false"); Jsi_RC rc = Jsi_JSONParse(interp, Jsi_DSValue(&dStr), ret, 0); Jsi_DSFree(&dStr); return rc; }
164,150,430,187,397,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