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,415 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_Gets(Jsi_Interp *interp, Jsi_Channel chan, char *s, int size) {
if (chan->fsPtr==0 || !chan->fsPtr->getsProc) return NULL;
return chan->fsPtr->getsProc(chan, s, size);
} | 216,562,834,371,625,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,416 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 StringMapCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
/* Now handles perl regex flag extensions.*/
const char *source_str;
const char *replace_str = NULL;
uint i, j;
int slen, source_len, replace_len, bLen;
const char *p;
bool nocase = 0;
/* Is a generic String.replace if _this->d.obj is a function */
ChkString(_this, funcPtr, source_str, &source_len, &bLen);
int argc = Jsi_ValueGetLength(interp, args);
Jsi_Value *repVal = Jsi_ValueArrayIndex(interp, args, skip);
if (Jsi_ValueIsArray(interp, repVal)==0 || repVal->d.obj->arrCnt&1)
return Jsi_LogError("expected even length array");
if (argc>(skip+1) && Jsi_ValueGetBoolean(interp, Jsi_ValueArrayIndex(interp, args, skip+1), &nocase) != JSI_OK)
return Jsi_LogError("expected boolean");
Jsi_DString dStr;
Jsi_DSInit(&dStr);
Jsi_Obj *obj = repVal->d.obj;
p = source_str;
for (j=0; j<(uint)bLen; j++, p++) {
for (i=0; i<obj->arrCnt; i+=2) {
if (!obj->arr[i]) continue;
if (!obj->arr[i+1]) continue;
const char *cp = Jsi_ValueToString(interp, obj->arr[i], &slen);
if (!cp || !slen) {
Jsi_DSFree(&dStr);
return Jsi_LogError("map src can not be empty");
}
int res = (nocase ? Jsi_Strncasecmp(cp, p, slen) : Jsi_Strncmp(cp, p, slen));
if (!res) {
replace_str = Jsi_ValueToString(interp, obj->arr[i+1], &replace_len);
Jsi_DSAppendLen(&dStr, replace_str, replace_len);
p += slen-1;
j += slen-1;
break;
}
}
if (i>=obj->arrCnt)
Jsi_DSAppendLen(&dStr, p, 1);
}
Jsi_ValueFromDS(interp, &dStr, ret);
return JSI_OK;
} | 324,387,363,019,174,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,417 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ws_http_redirect(struct lws *wsi, int code, Jsi_DString *tStr,
unsigned char **p, unsigned char *end)
{
char *loc = Jsi_DSValue(tStr);
uchar *start = *p;
char* cookie = Jsi_Strchr(loc, '|');
if (cookie) { *cookie= 0; cookie++; }
if (lws_add_http_header_status(wsi, code, p, end)
|| lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_LOCATION, (uchar *)loc, Jsi_Strlen(loc), p, end)
|| lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_CONTENT_TYPE,(uchar *)"text/html", 9, p,end)
|| lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_CONTENT_LENGTH, (uchar *)"0", 1, p, end))
return -1;
if (cookie && lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_SET_COOKIE, (uchar *)cookie, Jsi_Strlen(cookie), p, end))
return -1;
if (lws_finalize_http_header(wsi, p, end))
return -1;
return lws_write(wsi, start, *p - start, LWS_WRITE_HTTP_HEADERS);
} | 17,050,405,128,928,025,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,418 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 SysVerConvertCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
Jsi_Value *val = Jsi_ValueArrayIndex(interp, args, 0);
Jsi_Value *flag = Jsi_ValueArrayIndex(interp, args, 1);
if (!val) goto bail;
if (Jsi_ValueIsNumber(interp, val)) {
char buf[JSI_MAX_NUMBER_STRING*2];
Jsi_Number n;
if (Jsi_GetNumberFromValue(interp, val, &n) != JSI_OK)
goto bail;
jsi_VersionNormalize(n, buf, sizeof(buf));
int trunc = 0;
if (flag && (Jsi_GetIntFromValue(interp, flag, &trunc) != JSI_OK
|| trunc<0 || trunc>2))
return Jsi_LogError("arg2: bad trunc: expected int between 0 and 2");
if (trunc) {
int len = Jsi_Strlen(buf)-1;
while (trunc>0 && len>1) {
if (buf[len] == '0' && buf[len-1] == '.')
buf[len-1] = 0;
len -= 2;
trunc--;
}
}
Jsi_ValueMakeStringDup(interp, ret, buf);
return JSI_OK;
}
if (Jsi_ValueIsString(interp, val)) {
Jsi_Number n;
if (jsi_GetVerFromVal(interp, val, &n, 0) == JSI_OK) {
Jsi_ValueMakeNumber(interp, ret, n);
return JSI_OK;
}
}
bail:
Jsi_ValueMakeNull(interp, ret);
return JSI_OK;
} | 135,325,372,191,748,390,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,419 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 mdbEvalFinalize(MyDbEvalContext *p) {
if( p->prep) {
mdbReleaseStmt(p->jdb, p->prep, p->nocache);
p->prep = 0;
}
Jsi_DSFree(p->dzSql);
} | 54,656,227,379,608,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,420 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | jsonGenObject(Jsi_Interp *interp, Jsi_JsonParser *p, const char *js, uint pos, uint *endPos)
{
Jsi_Obj *obj = Jsi_ObjNewType(interp, JSI_OT_OBJECT);
Jsi_Value *nv, *v = Jsi_ValueMakeObject(interp, NULL, obj);
uint i, n, len;
Jsi_JsonTok *tok;
const char *t;
tok = p->tokens+pos;
for (i=pos+1, n=0; i<p->toknext && n<tok->size; i++, n++) {
Jsi_DString dStr;
t = Jsi_JsonGetTokstr(p, js, i, &len);
i++; n++;
if (n>=tok->size)
nv = Jsi_ValueMakeUndef(interp, NULL);
else
nv = jsonGen1Value(interp, p, js, i, &i, 0);
Jsi_DSInit(&dStr);
Jsi_DSAppendLen(&dStr, t, len);
Jsi_ObjInsert(interp, obj, Jsi_DSValue(&dStr), nv, 0);
Jsi_DSFree(&dStr);
}
if (endPos)
*endPos = i;
return v;
} | 251,474,058,672,822,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,421 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_FunctionArguments(Jsi_Interp *interp, Jsi_Value *func, int *argcPtr)
{
Jsi_FuncObj *funcPtr;
Jsi_Func *f;
if (!Jsi_ValueIsFunction(interp, func))
return JSI_ERROR;
funcPtr = func->d.obj->d.fobj;
f = funcPtr->func;
SIGASSERT(f, FUNC);
*argcPtr = f->argnames->count;
return JSI_OK;
} | 163,930,600,657,290,680,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,422 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_FSChmodProc(Jsi_Interp *interp, Jsi_Value* path, int mode) {
#ifdef __WIN32
return -1;
#else
const char *pathPtr = Jsi_ValueToString(interp, path, NULL);
Jsi_DString dStr = {};
if (*pathPtr == '~')
pathPtr = jsi_TildePath(interp, pathPtr, &dStr);
int rc = chmod(pathPtr, mode);
Jsi_DSFree(&dStr);
return rc;
#endif
} | 57,592,709,987,113,620,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,423 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 JSONParseCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
bool strict = 1;
Jsi_Value *jsv = Jsi_ValueArrayIndex(interp, args, 1);
if (jsv && Jsi_ValueGetBoolean(interp, jsv, &strict) != JSI_OK)
return Jsi_LogError("Expected boolean");
jsv = Jsi_ValueArrayIndex(interp, args, 0);
const char *js = Jsi_ValueToString(interp, jsv, NULL);
return Jsi_JSONParse(interp, js, ret, strict);
} | 5,847,789,435,844,874,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,424 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueToEnum(Jsi_Interp *interp, Jsi_OptionSpec* spec, Jsi_Value *inValue, const char *inStr, void *record, Jsi_Wide flags)
{
int n = 0;
char *s = (char*)(((char*)record) + spec->offset);
const char **list = (const char **)spec->data;
Jsi_OptionSpec* es=NULL;
int fflags = (flags|spec->flags);
int cflags = (fflags&JSI_OPT_CUST_NOCASE?JSI_CMP_NOCASE:0);
if (fflags&JSI_OPT_ENUM_EXACT)
cflags |= JSI_CMP_EXACT;
if (list && (fflags & JSI_OPT_ENUM_SPEC)) {
es = (typeof(es))list;
while (es->id != JSI_OPTION_END) es++;
list = es->init.STRKEY;
es = (typeof(es))spec->data;
}
if (!list)
return Jsi_LogError("custom enum spec did not set data: %s", spec->name);
if (inStr) {
if (JSI_OK != Jsi_GetIndex(interp, (char*)inStr, list, "enum", cflags, &n))
return JSI_ERROR;
} else
#ifndef JSI_LITE_ONLY
if (JSI_OK != Jsi_ValueGetIndex(interp, inValue, list, "enum", cflags, &n))
return JSI_ERROR;
#endif
if (fflags&JSI_OPT_ENUM_UNSIGNED) {
uint64_t u = (uint64_t)n;
if (es)
u = es[n].value;
switch (spec->size) {
case 1: *(uint8_t*)s = (uint8_t)u; break;
case 2: *(uint16_t*)s = (uint16_t)u; break;
case 4: *(uint32_t*)s = (uint32_t)u; break;
case 8: *(uint64_t*)s = (uint64_t)u; break;
default:
return Jsi_LogError("enum size must be 1, 2, 4, or 8: %s", spec->name);
}
} else {
int64_t m = n;
if (es)
m = es[n].value;
switch (spec->size) {
case 1: *(int8_t*)s = (int8_t)m; break;
case 2: *(int16_t*)s = (int16_t)m; break;
case 4: *(int32_t*)s = (int32_t)m; break;
case 8: *(int64_t*)s = (int64_t)m; break;
default:
return Jsi_LogError("enum size must be 1, 2, 4, or 8: %s", spec->name);
}
}
return JSI_OK;
} | 165,796,502,254,938,410,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,425 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 dbEvalStepSub(DbEvalContext *p, int release, int *erc) {
int rcs;
Jsi_Db *jdb = p->jdb;
Jsi_Interp *interp = jdb->interp;
JSI_NOTUSED(interp);
SqlPreparedStmt *pPreStmt = p->pPreStmt;
SQLSIGASSERT(pPreStmt, STMT);
sqlite3_stmt *pStmt = pPreStmt->pStmt;
if (jdb->debug & TMODE_STEP)
JSI_DBQUERY_PRINTF( "DEBUG: step: %s\n", pPreStmt->zSql);
rcs = sqlite3_step(pStmt);
if( rcs==SQLITE_BUSY ) {
if (erc) *erc = -2;
return JSI_ERROR;
}
if( rcs==SQLITE_ROW ) {
return JSI_OK;
}
if( p->pArray ) {
dbEvalRowInfo(p, 0, 0, 0);
}
rcs = sqlite3_reset(pStmt);
jdb->stepCnt = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_FULLSCAN_STEP,1);
jdb->sortCnt = sqlite3_stmt_status(pStmt,SQLITE_STMTSTATUS_SORT,1);
if (release==0 && rcs==SQLITE_OK)
return JSI_BREAK;
dbReleaseColumnNames(p);
p->pPreStmt = 0;
if( rcs!=SQLITE_OK ) {
/* If a run-time error occurs, report the error and stop reading
** the SQL. */
Jsi_LogError("%s", sqlite3_errmsg(jdb->db));
dbReleaseStmt(jdb, pPreStmt, 1);
return JSI_ERROR;
} else {
dbReleaseStmt(jdb, pPreStmt, p->nocache);
}
return JSI_BREAK;
} | 263,288,186,570,950,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,426 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 MutexDone(Jsi_Mutex *mtx) { pthread_mutex_destroy(&mtx->mtx); } | 311,239,492,082,655,580,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,427 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ScopeChain *jsi_ScopeChainNew(Jsi_Interp *interp, int cnt)
{
jsi_ScopeChain *r = (jsi_ScopeChain *)Jsi_Calloc(1, sizeof(*r));
r->interp = interp;
SIGINIT(r,SCOPE);
r->chains = (Jsi_Value **)Jsi_Calloc(cnt, sizeof(r->chains[0]));
r->chains_cnt = cnt;
return r;
} | 23,064,753,017,292,837,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,428 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_LoadFunction(Jsi_Interp *interp, const char *str, Jsi_Value *tret) {
Jsi_DString dStr = {};
Jsi_Value *v;
int i;
const char *curFile = interp->curFile;
interp->curFile = "<jsiLoadFunction>";
for (i=0; i<2; i++) {
Jsi_DSAppend(&dStr, "Jsi_Auto.", str, NULL);
Jsi_VarLookup(interp, Jsi_DSValue(&dStr));
v = Jsi_NameLookup(interp, Jsi_DSValue(&dStr));
if (v)
jsi_ValueDebugLabel(v, "jsiLoadFunction","f1");
Jsi_DSFree(&dStr);
if (v) {
const char *cp = Jsi_ValueGetDString(interp, v, &dStr, 0);
v = NULL;
if (Jsi_EvalString(interp, cp, 0) == JSI_OK) {
v = Jsi_NameLookup(interp, str);
if (v)
jsi_ValueDebugLabel(v, "jsiLoadFunction","f2");
}
Jsi_DSFree(&dStr);
if (v) {
tret = v;
break;
}
}
if (interp->autoLoaded++ || i>0)
break;
/* Index not in memory, so try loading Jsi_Auto from the autoload.jsi file. */
if (interp->autoFiles == NULL)
return tret;
Jsi_Value **ifs = &interp->autoFiles;
int i, ifn = 1;
if (Jsi_ValueIsArray(interp, interp->autoFiles)) {
ifs = interp->autoFiles->d.obj->arr;
ifn = interp->autoFiles->d.obj->arrCnt;
}
for (i=0; i<ifn; i++) {
if (Jsi_EvalFile(interp, ifs[i], 0) != JSI_OK)
break;
interp->autoLoaded++;
}
}
interp->curFile = curFile;
return tret;
} | 164,184,640,954,985,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,429 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 mdbEvalStepSub(MyDbEvalContext *eval, int release, int *erc) {
MySqlObj *jdb = eval->jdb;
Jsi_Interp *interp = jdb->interp;
MysqlPrep *prep = eval->prep;
SQLSIGASSERT(prep, STMT);
MYSQL_STMT *myStmt = prep->myStmt;
if (jdb->debug & mdbTMODE_STEP)
JSI_DBQUERY_PRINTF( "DEBUG: step: %s\n", prep->zSql);
int m = mysql_stmt_fetch(myStmt);
if (m == MYSQL_NO_DATA)
return JSI_BREAK;
if (m)
return Jsi_LogError("fetch failed: %s", mysql_error(jdb->db));
return JSI_OK;
#if 0
if( eval->pArray ) {
mdbEvalRowInfo(eval, 0, 0, 0);
}
if (release==0)
return JSI_BREAK;
eval->prep = 0;
return JSI_OK;
#endif
} | 324,886,912,840,658,150,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,430 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 dbExecCmd(Jsi_Db *jdb, const char *zQuery, int *erc)
{
int rc = sqlite3_exec(jdb->db, zQuery, 0, 0, 0);
if (rc == SQLITE_BUSY) {
if (erc) *erc = -2;
} else if (rc != SQLITE_OK) {
if (erc) *erc = -1;
} else
return 1;
return 0;
} | 149,341,444,442,535,050,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,431 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 dbWalHandler( void *cd, sqlite3 *db, const char *zDb, int nEntry ){
int rc;
Jsi_Db *jdb = (Jsi_Db*)cd;
Jsi_Interp *interp = jdb->interp;
Jsi_Value *vpargs, *items[3] = {}, *ret;
items[0] = Jsi_ValueNewObj(interp, jdb->fobj);
items[1] = Jsi_ValueMakeStringDup(interp, NULL, zDb);
items[2] = Jsi_ValueMakeNumber(interp, NULL, (Jsi_Number)nEntry);
vpargs = Jsi_ValueMakeObject(interp, NULL, Jsi_ObjNewArray(interp, items, 3, 0));
Jsi_IncrRefCount(interp, vpargs);
ret = Jsi_ValueNew(interp);
rc = Jsi_FunctionInvoke(interp, jdb->onWalHook, vpargs, &ret, NULL);
Jsi_DecrRefCount(interp, vpargs);
if (rc != JSI_OK) {
jdb->errCnt++;
rc = 1;
} else
rc = dbGetIntBool(jdb->interp, ret);
Jsi_DecrRefCount(interp, ret);
return rc;
} | 254,878,421,848,107,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,432 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_InitValue(Jsi_Interp *interp, int release)
{
return JSI_OK;
} | 263,808,733,902,019,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,433 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_HashSearchFirst(Jsi_Hash *tablePtr, Jsi_HashSearch *searchPtr)
{
searchPtr->tablePtr = tablePtr;
searchPtr->nextIndex = 0;
searchPtr->nextEntryPtr = NULL;
return Jsi_HashSearchNext(searchPtr);
} | 301,270,545,889,650,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,434 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 dbFlushStmtCache( Jsi_Db *jdb ) {
Jsi_ListClear(jdb->stmtCache);
jdb->stmtCacheCnt = 0;
} | 298,174,634,257,422,440,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,435 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 dbPrepareAndBind(
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 */
) {
if (dbPrepareStmt(jdb, zIn, pzOut, ppPreStmt) != JSI_OK)
return JSI_ERROR;
return dbBindStmt(jdb, *ppPreStmt);
} | 288,942,127,485,793,170,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,436 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_Wide Jsi_Tell(Jsi_Interp *interp, Jsi_Channel chan) {
if (chan->fsPtr==0 || !chan->fsPtr->tellProc) return -1;
return chan->fsPtr->tellProc(chan);
} | 685,921,802,469,119,100,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,437 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_CaseExprStat *exprstat_new(jsi_Pstate *pstate, Jsi_OpCodes *expr, Jsi_OpCodes *stat, int isdef)
{
jsi_CaseExprStat *r = (jsi_CaseExprStat*)Jsi_Calloc(1,sizeof(*r));
r->sig = JSI_SIG_CASESTAT;
r->expr = expr;
r->stat = stat;
r->isdefault = isdef;
return r;
} | 16,684,859,276,222,506,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,438 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | HashStringCreate( Jsi_Hash *tablePtr, const void *key, bool *newPtr)
{
jsi_Hash hval;
Jsi_HashEntry **bucketPtr;
Jsi_HashEntry *hPtr;
size_t size, hindex;
hval = HashString((const char*)key);
hindex = hval & tablePtr->mask;
for (hPtr = tablePtr->buckets[hindex]; hPtr != NULL;
hPtr = hPtr->nextPtr) {
if (hPtr->hval == hval) {
const char *p1, *p2;
for (p1 = (const char*)key, p2 = hPtr->key.string; ; p1++, p2++) {
if (*p1 != *p2) {
break;
}
if (*p1 == '\0') {
if (newPtr)
*newPtr = 0;
return hPtr;
}
}
}
}
if (newPtr)
*newPtr = 1;
size = sizeof(Jsi_HashEntry) + Jsi_Strlen((char*)key) - sizeof(jsi_HashKey) + 1;
hPtr = (Jsi_HashEntry*)Jsi_Calloc(1, size);
hPtr->typ = JSI_MAP_HASH;
bucketPtr = tablePtr->buckets + hindex;
hPtr->tablePtr = tablePtr;
hPtr->nextPtr = *bucketPtr;
hPtr->hval = hval;
hPtr->clientData = 0;
Jsi_Strcpy(hPtr->key.string, (char*)key);
*bucketPtr = hPtr;
tablePtr->numEntries++;
if (tablePtr->numEntries >= tablePtr->rebuildSize)
RebuildTable(tablePtr);
return hPtr;
} | 101,704,737,145,077,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,439 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static const char* jsw_getReasonStr(enum lws_callback_reasons reason) {
typedef struct { enum lws_callback_reasons r; const char *name; } ssType;
static ssType ss[] = {
#define MKLCBS(n) { n, #n }
MKLCBS(LWS_CALLBACK_PROTOCOL_INIT),
MKLCBS(LWS_CALLBACK_PROTOCOL_DESTROY), MKLCBS(LWS_CALLBACK_WSI_CREATE),
MKLCBS(LWS_CALLBACK_WSI_DESTROY),MKLCBS(LWS_CALLBACK_OPENSSL_LOAD_EXTRA_CLIENT_VERIFY_CERTS),
MKLCBS(LWS_CALLBACK_OPENSSL_LOAD_EXTRA_SERVER_VERIFY_CERTS),
MKLCBS(LWS_CALLBACK_OPENSSL_PERFORM_CLIENT_CERT_VERIFICATION),
MKLCBS(LWS_CALLBACK_OPENSSL_CONTEXT_REQUIRES_PRIVATE_KEY),
MKLCBS(LWS_CALLBACK_SERVER_NEW_CLIENT_INSTANTIATED), MKLCBS(LWS_CALLBACK_HTTP),
MKLCBS(LWS_CALLBACK_HTTP_BODY), MKLCBS(LWS_CALLBACK_HTTP_BODY_COMPLETION),
MKLCBS(LWS_CALLBACK_HTTP_FILE_COMPLETION), MKLCBS(LWS_CALLBACK_HTTP_WRITEABLE),
MKLCBS(LWS_CALLBACK_CLOSED_HTTP), MKLCBS(LWS_CALLBACK_FILTER_HTTP_CONNECTION),
MKLCBS(LWS_CALLBACK_ESTABLISHED),
MKLCBS(LWS_CALLBACK_CLOSED),
MKLCBS(LWS_CALLBACK_SERVER_WRITEABLE),
MKLCBS(LWS_CALLBACK_RECEIVE), MKLCBS(LWS_CALLBACK_RECEIVE_PONG),
MKLCBS(LWS_CALLBACK_WS_PEER_INITIATED_CLOSE), MKLCBS(LWS_CALLBACK_FILTER_PROTOCOL_CONNECTION),
MKLCBS(LWS_CALLBACK_CONFIRM_EXTENSION_OKAY),
MKLCBS(LWS_CALLBACK_CLIENT_CONNECTION_ERROR),
MKLCBS(LWS_CALLBACK_CLIENT_FILTER_PRE_ESTABLISH), MKLCBS(LWS_CALLBACK_CLIENT_ESTABLISHED),
MKLCBS(LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER), MKLCBS(LWS_CALLBACK_CLIENT_RECEIVE),
MKLCBS(LWS_CALLBACK_CLIENT_RECEIVE_PONG),
MKLCBS(LWS_CALLBACK_CLIENT_WRITEABLE), MKLCBS(LWS_CALLBACK_CLIENT_CONFIRM_EXTENSION_SUPPORTED),
MKLCBS(LWS_CALLBACK_WS_EXT_DEFAULTS), MKLCBS(LWS_CALLBACK_FILTER_NETWORK_CONNECTION),
MKLCBS(LWS_CALLBACK_GET_THREAD_ID), MKLCBS(LWS_CALLBACK_ADD_POLL_FD),
MKLCBS(LWS_CALLBACK_DEL_POLL_FD), MKLCBS(LWS_CALLBACK_CHANGE_MODE_POLL_FD), MKLCBS(LWS_CALLBACK_LOCK_POLL),
MKLCBS(LWS_CALLBACK_UNLOCK_POLL),
#if (LWS_LIBRARY_VERSION_MAJOR>1)
MKLCBS(LWS_CALLBACK_CGI),
MKLCBS(LWS_CALLBACK_CGI_TERMINATED),
MKLCBS(LWS_CALLBACK_CGI_STDIN_DATA),
MKLCBS(LWS_CALLBACK_CGI_STDIN_COMPLETED),
MKLCBS(LWS_CALLBACK_SESSION_INFO),
MKLCBS(LWS_CALLBACK_GS_EVENT),
MKLCBS(LWS_CALLBACK_HTTP_PMO),
MKLCBS(LWS_CALLBACK_RAW_RX),
MKLCBS(LWS_CALLBACK_RAW_CLOSE),
MKLCBS(LWS_CALLBACK_RAW_WRITEABLE),
MKLCBS(LWS_CALLBACK_RAW_ADOPT),
MKLCBS(LWS_CALLBACK_RAW_ADOPT_FILE),
MKLCBS(LWS_CALLBACK_ADD_HEADERS),
MKLCBS(LWS_CALLBACK_CHECK_ACCESS_RIGHTS),
MKLCBS(LWS_CALLBACK_PROCESS_HTML),
MKLCBS(LWS_CALLBACK_ESTABLISHED_CLIENT_HTTP),
MKLCBS(LWS_CALLBACK_CLOSED_CLIENT_HTTP),
MKLCBS(LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ),
MKLCBS(LWS_CALLBACK_RECEIVE_CLIENT_HTTP),
MKLCBS(LWS_CALLBACK_COMPLETED_CLIENT_HTTP),
MKLCBS(LWS_CALLBACK_CLIENT_HTTP_WRITEABLE),
MKLCBS(LWS_CALLBACK_HTTP_BIND_PROTOCOL),
MKLCBS(LWS_CALLBACK_HTTP_DROP_PROTOCOL),
MKLCBS(LWS_CALLBACK_OPENSSL_PERFORM_SERVER_CERT_VERIFICATION),
MKLCBS(LWS_CALLBACK_RAW_RX_FILE),
MKLCBS(LWS_CALLBACK_RAW_WRITEABLE_FILE),
MKLCBS(LWS_CALLBACK_RAW_CLOSE_FILE),
MKLCBS(LWS_CALLBACK_USER),
#endif
#if (LWS_LIBRARY_VERSION_NUMBER>=3000000)
MKLCBS(LWS_CALLBACK_SSL_INFO),
MKLCBS(LWS_CALLBACK_CGI_PROCESS_ATTACH),
MKLCBS(LWS_CALLBACK_CLIENT_CLOSED),
MKLCBS(LWS_CALLBACK_TIMER),
MKLCBS(LWS_CALLBACK_EVENT_WAIT_CANCELLED),
MKLCBS(LWS_CALLBACK_CHILD_CLOSING),
MKLCBS(LWS_CALLBACK_CHILD_WRITE_VIA_PARENT),
MKLCBS(LWS_CALLBACK_VHOST_CERT_AGING),
MKLCBS(LWS_CALLBACK_VHOST_CERT_UPDATE),
#endif
{(enum lws_callback_reasons)0, NULL }
};
int i = -1;
while (ss[++i].name)
if (ss[i].r == reason)
return ss[i].name;
return "";
} | 338,199,986,058,477,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,440 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ObjTypeStr(Jsi_Interp *interp, Jsi_Obj *o)
{
switch (o->ot) {
case JSI_OT_BOOL: return "boolean"; break;
case JSI_OT_FUNCTION: return "function"; break;
case JSI_OT_NUMBER: return "number"; break;
case JSI_OT_STRING: return "string"; break;
case JSI_OT_REGEXP: return "regexp"; break;
case JSI_OT_ITER: return "iter"; break;
case JSI_OT_OBJECT: if (!o->isarrlist) return "object";
case JSI_OT_ARRAY: return "array"; break;
case JSI_OT_USEROBJ:
if (o->__proto__) {
Jsi_HashEntry *hPtr;
Jsi_HashSearch search;
for (hPtr = Jsi_HashSearchFirst(interp->thisTbl,&search); hPtr != NULL;
hPtr = Jsi_HashSearchNext(&search))
if (Jsi_HashValueGet(hPtr) == o->__proto__)
return (char*)Jsi_HashKeyGet(hPtr);
}
return "userobj";
break;
//return Jsi_ObjGetType(interp, v->d.obj);
default:
break;
}
return "";
} | 262,330,969,023,310,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,441 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_case2(Jsi_TreeEntry* n) {
Jsi_TreeEntry* s = sibling(n);
if (node_color(s) == _JSI_TREE_RED) {
set_color(n->parent, _JSI_TREE_RED);
set_color(s, _JSI_TREE_BLACK);
if (n == n->parent->left)
rotate_left(n->parent);
else
rotate_right(n->parent);
}
delete_case3(n);
} | 247,177,335,895,746,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,442 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_BitsetToValue(Jsi_Interp *interp, Jsi_OptionSpec* spec, Jsi_Value **outValue, Jsi_DString *outStr, void *record, Jsi_Wide flags)
{
int i, n, cnt = 0, *s = (int*)(((char*)record) + spec->offset);
const char **list = (const char**)spec->data;
if (!list)
return Jsi_LogError("custom enum spec did not set data: %s", spec->name);
if (outStr) {
n = *s;
for (i=0; list[i]; i++) {
if (i >= (int)(spec->size*8))
return Jsi_LogError("list larger than field size: %s", spec->name);
if (!(n & (1<<i)))
continue;
if (cnt++)
Jsi_DSAppendLen(outStr, ", ", 1);
Jsi_DSAppendLen(outStr, list[i], -1);
}
return JSI_OK;
}
#ifndef JSI_LITE_ONLY
Jsi_Obj *obj = Jsi_ObjNewType(interp, JSI_OT_ARRAY);
n = *s;
for (i=0; list[i]; i++) {
Jsi_Value *v;
if (!(n&(1<<i))) continue;
cnt++;
v = Jsi_ValueMakeStringKey(interp, NULL, list[i]);
Jsi_ObjArrayAdd(interp, obj, v);
}
Jsi_ValueMakeArrayObject(interp, outValue, obj);
#endif
return JSI_OK;
} | 119,352,705,700,096,050,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,443 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_MapSearchDone (Jsi_MapSearch *searchPtr){
switch (searchPtr->typ) {
case JSI_MAP_HASH: break;
case JSI_MAP_TREE: Jsi_TreeSearchDone(&searchPtr->v.tree); break;
case JSI_MAP_LIST: break;
case JSI_MAP_NONE: break;
}
} | 135,565,517,508,532,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,444 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_evalStrFile(Jsi_Interp* interp, Jsi_Value *path, const char *str, int flags, int level)
{
Jsi_Channel tinput = NULL, input = Jsi_GetStdChannel(interp, 0);
Jsi_Value *npath = path;
Jsi_RC rc = JSI_ERROR;
const char *ustr = NULL, *ostr = str;
if (Jsi_MutexLock(interp, interp->Mutex) != JSI_OK)
return rc;
int oldSp, uskip = 0, fncOfs = 0, fnLen;
int oldef = interp->evalFlags;
jsi_Pstate *oldps = interp->ps;
const char *oldFile = interp->curFile;
char *origFile = Jsi_ValueString(interp, path, &fnLen);
const char *fname = origFile;
char *oldDir = interp->curDir, *cp;
char dirBuf[PATH_MAX];
jsi_Pstate *ps = NULL;
jsi_FileInfo *fi = NULL;
int exists = (flags&JSI_EVAL_EXISTS);
int ignore = (flags&JSI_EVAL_ERRIGNORE);
if (flags & JSI_EVAL_GLOBAL)
level = 1;
int oisi = interp->isMain;
if (flags & JSI_EVAL_ISMAIN)
interp->isMain = 1;
oldSp = interp->framePtr->Sp;
dirBuf[0] = 0;
Jsi_DString dStr, fStr;
Jsi_DSInit(&dStr);
Jsi_DSInit(&fStr);
if (str == NULL) {
if (fname != NULL) {
if (fnLen>2 && fname[fnLen-1]=='/') {
Jsi_DSAppendLen(&fStr, fname, fnLen-1);
const char *fcp = Jsi_DSValue(&fStr), *fce = strrchr(fcp,'/');
if (fce) {
fname = Jsi_DSAppend(&fStr, fce, ".jsi", NULL);
npath = Jsi_ValueNewStringDup(interp, fname);
Jsi_IncrRefCount(interp, npath);
}
}
if (!Jsi_Strcmp(fname,"-"))
input = Jsi_GetStdChannel(interp, 0);
else {
/* Use translated FileName. */
if (interp->curDir && fname[0] != '/' && fname[0] != '~') {
char dirBuf2[PATH_MAX], *np;
snprintf(dirBuf, sizeof(dirBuf), "%s/%s", interp->curDir, fname);
if ((np=Jsi_FileRealpathStr(interp, dirBuf, dirBuf2)) == NULL) {
Jsi_LogError("Can not open '%s'", fname);
goto bail;
}
if (npath != path)
Jsi_IncrRefCount(interp, npath);
npath = Jsi_ValueNewStringDup(interp, np);
Jsi_IncrRefCount(interp, npath);
fname = Jsi_ValueString(interp, npath, NULL);
}
if (flags&JSI_EVAL_ARGV0) {
if (interp->argv0)
Jsi_DecrRefCount(interp, interp->argv0);
interp->argv0 = Jsi_ValueNewStringDup(interp, fname);
Jsi_IncrRefCount(interp, interp->argv0);
}
bool osafe = interp->isSafe;
if (interp->startSafe && flags&JSI_EVAL_ARGV0) {
if (interp->safeReadDirs || interp->safeMode == jsi_safe_None)
interp->isSafe = 0;
else {
char vds[PATH_MAX], *cp;
const char *vda[2] = {vds};
Jsi_Strncpy(vds, Jsi_ValueString(interp, npath, NULL), sizeof(vds)-1);
vds[sizeof(vds)-1] = 0;
cp = Jsi_Strrchr(vds, '/');
if (cp)
cp[1] = 0;
Jsi_DString pStr = {};
vda[1] = Jsi_GetCwd(interp, &pStr);
interp->safeReadDirs = Jsi_ValueNewArray(interp, vda, 2);
Jsi_IncrRefCount(interp, interp->safeReadDirs);
if (interp->safeMode == jsi_safe_WriteRead || interp->safeMode == jsi_safe_Lockdown) {
if (!interp->safeWriteDirs) {
interp->safeWriteDirs = interp->safeReadDirs;
Jsi_IncrRefCount(interp, interp->safeWriteDirs);
}
} else if (interp->safeMode == jsi_safe_Write) {
interp->safeWriteDirs = Jsi_ValueNewArray(interp, vda+1, 1);
Jsi_IncrRefCount(interp, interp->safeWriteDirs);
}
Jsi_DSFree(&pStr);
}
}
tinput = input = Jsi_Open(interp, npath, (exists?"-r":"r"));
interp->isSafe = osafe;
if (!input) {
if (exists)
rc = JSI_OK;
//Jsi_LogError("Can not open '%s'", fname);
goto bail;
}
}
cp = Jsi_Strrchr(fname, '.');
if (cp && !Jsi_Strcmp(cp, ".jsi") && interp->isMain) {
interp->typeCheck.parse = interp->typeCheck.run = interp->typeCheck.all = 1;
interp->strict = 1;
}
bool isNew;
Jsi_HashEntry *hPtr;
hPtr = Jsi_HashEntryNew(interp->fileTbl, fname, &isNew);
if (isNew == 0 && hPtr) {
if ((flags & JSI_EVAL_ONCE)) {
rc = JSI_OK;
goto bail;
}
fi = (jsi_FileInfo *)Jsi_HashValueGet(hPtr);
if (!fi) goto bail;
interp->curFile = fi->fileName;
interp->curDir = fi->dirName;
} else {
fi = (jsi_FileInfo *)Jsi_Calloc(1,sizeof(*fi));
if (!fi) goto bail;
Jsi_HashValueSet(hPtr, fi);
fi->origFile = (char*)Jsi_KeyAdd(interp, origFile);
interp->curFile = fi->fileName = (char*)Jsi_KeyAdd(interp, fname);
char *dfname = Jsi_Strdup(fname);
if ((cp = Jsi_Strrchr(dfname,'/')))
*cp = 0;
interp->curDir = fi->dirName = (char*)Jsi_KeyAdd(interp, dfname);
Jsi_Free(dfname);
}
if (!input->fname)
input->fname = interp->curFile;
int cnt = 0, noncmt = 0, jppOpts[4]={};
uint ilen;
char buf[JSI_BUFSIZ*2];
const char *jpp;
while (cnt<MAX_LOOP_COUNT) {
if (!Jsi_Gets(interp, input, buf, sizeof(buf)))
break;
if (++cnt==1 && (!(flags&JSI_EVAL_NOSKIPBANG)) && (buf[0] == '#' && buf[1] == '!')) {
Jsi_DSAppend(&dStr, "\n", NULL);
uskip=1;
continue;
}
if (!noncmt) {
int bi;
if (!buf[0] || (buf[0] == '/' && buf[1] == '/'))
goto cont;
for (bi=0; buf[bi]; bi++) if (!isspace(buf[bi])) break;
if (!buf[bi])
goto cont;
}
if (!noncmt++)
fncOfs = Jsi_DSLength(&dStr)-uskip;
jpp = interp->jsppChars;
if (jpp || interp->unitTest)
ilen = Jsi_Strlen(buf);
if (interp->unitTest && buf[0]==';' && buf[1] && buf[2]) {
if (interp->unitTest&1 && jsi_JsPreprocessLine(interp, buf, sizeof(buf), ilen, jppOpts, cnt) != JSI_OK)
goto bail;
} else if (interp->jsppCallback && interp->jsppChars) {
if (jsi_JsPreprocessLineCB(interp, buf, sizeof(buf), ilen, jppOpts, cnt) != JSI_OK)
goto bail;
}
cont:
Jsi_DSAppend(&dStr, buf, NULL);
}
if (cnt>=MAX_LOOP_COUNT)
Jsi_LogError("source file too large");
str = Jsi_DSValue(&dStr);
}
if (interp->curDir && (flags&JSI_EVAL_AUTOINDEX))
Jsi_AddAutoFiles(interp, interp->curDir);
}
ustr = str + fncOfs;
// See if "use XXX" is on first non // or empty line (or second if there is a #! on first line)
if (ustr && *ustr && !Jsi_Strncmp(ustr+uskip, "\"use ", 5)) {
ustr += 5+uskip;
const char *cpe = ustr;
while (*cpe && *cpe != '\"' && *cpe != '\n' && (isalpha(*cpe) || *cpe ==',' || *cpe =='!')) cpe++;
if (*cpe == '\"') {
Jsi_DString cStr;
Jsi_DSInit(&cStr);
cpe = Jsi_DSAppendLen(&cStr, ustr, (cpe-ustr));
rc = jsi_ParseTypeCheckStr(interp, cpe);
Jsi_DSFree(&cStr);
if (rc != JSI_OK)
goto bail;
}
}
/* TODO: cleanup interp->framePtr->Sp stuff. */
oldSp = interp->framePtr->Sp;
// Evaluate code.
rc = JSI_OK;
ps = jsiNewParser(interp, str, input, 0);
interp->evalFlags = flags;
if (!ps)
rc = JSI_ERROR;
else {
Jsi_ValueMakeUndef(interp, &interp->retValue);
interp->ps = ps;
Jsi_Value *retValue = interp->retValue;
if (!interp->strict)
interp->strict = (jsi_GetDirective(interp, ps->opcodes, "use strict")!=NULL);
const char *curFile = interp->curFile;
if (level <= 0)
rc = jsi_evalcode(ps, NULL, ps->opcodes, interp->gsc, interp->csc, interp->csc, &retValue);
else {
jsi_Frame *fptr = interp->framePtr;
while (fptr && fptr->level > level)
fptr = fptr->parent;
if (!fptr)
rc = JSI_ERROR;
else
rc = jsi_evalcode(ps, NULL, ps->opcodes, fptr->ingsc, fptr->incsc, fptr->inthis, &retValue);
}
interp->curFile = curFile;
if (rc != JSI_OK)
rc = (ignore?JSI_OK:JSI_ERROR);
else if (ps->last_exception || oldps->last_exception)
Jsi_ValueDup2(interp, &oldps->last_exception, ps->last_exception); //TODO: dup even if null?
interp->ps = oldps;
interp->evalFlags = oldef;
if (rc == JSI_OK && ps && !ostr)
fi->str = ps->lexer->d.str;
}
bail:
interp->curFile = oldFile;
interp->curDir = oldDir;
interp->framePtr->Sp = oldSp;
interp->isMain = oisi;
if (path != npath)
Jsi_DecrRefCount(interp, npath);
Jsi_DSFree(&dStr);
Jsi_DSFree(&fStr);
if (tinput)
Jsi_Close(interp, tinput);
Jsi_MutexUnlock(interp, interp->Mutex);
if (interp->exited && interp->level <= 0)
{
rc = JSI_EXIT;
if (!interp->parent)
Jsi_InterpDelete(interp);
}
return rc;
} | 281,767,822,808,597,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,445 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 DeBackSlashify(char *cp) {
char *dp = cp;
while (*cp) {
if (*cp == '\\') {
*dp = '/';
} else
*dp = *cp;
cp++; dp++;
}
*dp = 0;
} | 114,043,468,968,811,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,446 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ewith(jsi_Pstate *p, jsi_Pline *line) { JSI_NEW_CODESLN(0,OP_EWITH, 0); } | 260,390,689,646,036,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,447 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_wsService(jsi_wsCmdObj *cmdPtr)
{
int n = 0;
struct timeval tv;
if (cmdPtr->inUpdate) return 0;
cmdPtr->inUpdate = 1;
gettimeofday(&tv, NULL);
int to = cmdPtr->recvBufTimeout;
if (to>0 && cmdPtr->recvBufCnt) { // Flush buffered data.
jsi_wsPss *pss = NULL;
Jsi_HashEntry *hPtr;
Jsi_HashSearch cursor;
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 (Jsi_DSLength(&pss->recvBuf)<=0) continue;
if (pss->stats.recvLast && difftime(time(NULL), pss->stats.recvLast)<(double)to) continue;
jsi_wsrecv_flush(cmdPtr, pss);
}
}
/*
* This provokes the LWS_CALLBACK_SERVER_WRITEABLE for every
* live websocket connection using the DUMB_INCREMENT protocol,
* as soon as it can take more packets (usually immediately)
*/
if (((unsigned int)tv.tv_usec - cmdPtr->oldus) > 50000) {
lws_callback_on_writable_all_protocol(cmdPtr->context, &cmdPtr->protocols[JWS_PROTOCOL_WEBSOCK]);
cmdPtr->oldus = tv.tv_usec;
}
#ifdef EXTERNAL_POLL
/*
* this represents an existing server's single poll action
* which also includes libwebsocket sockets
*/
n = poll(jsi_wspollfds, jsi_wsnum_pollfds, 50);
if (n < 0) {
n = 0;
goto done;
}
if (n)
for (n = 0; n < jsi_wsnum_pollfds; n++)
if (jsi_wspollfds[n].revents)
/*
* returns immediately if the fd does not
* match anything under libwebsockets
* control
*/
if (lws_service_fd(context, &jsi_wspollfds[n]) < 0) {
n = -1;
goto done;
}
done:
#else
n = lws_service(cmdPtr->context, 50);
#endif
if (cmdPtr->onModify) {
jsi_wsOnModify(cmdPtr);
}
cmdPtr->inUpdate = 0;
return n;
} | 156,463,461,396,186,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,448 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_wscallback_http(struct lws *wsi,
enum lws_callback_reasons reason, void *user,
void *in, size_t len)
{
struct lws_context *context = lws_get_context(wsi);
const char *inPtr = (char*)in;
char client_name[128], client_ip[128];
const char *res = "";
#ifdef EXTERNAL_POLL
int m;
int fd = (int)(long)user;
#endif
jsi_wsCmdObj *cmdPtr = (jsi_wsCmdObj *)lws_context_user(context);
if (!cmdPtr) {
fprintf(stderr, "bad ws context\n");
return -1;
}
jsi_wsPss *pss = NULL;
Jsi_Interp *interp = cmdPtr->interp;
Jsi_Value* callPtr = NULL;
int rc = 0, deflt = 0;
WSSIGASSERT(cmdPtr, OBJ);
if (Jsi_InterpGone(interp))
cmdPtr->deleted = 1;
if (cmdPtr->debug>=128)
fprintf(stderr, "HTTP CALLBACK: len=%d, %p %d:%s\n", (int)len, user, reason, jsw_getReasonStr(reason));
switch (reason) {
#ifndef EXTERNAL_POLL
case LWS_CALLBACK_GET_THREAD_ID:
case LWS_CALLBACK_UNLOCK_POLL:
case LWS_CALLBACK_PROTOCOL_INIT:
case LWS_CALLBACK_ADD_POLL_FD:
case LWS_CALLBACK_DEL_POLL_FD:
case LWS_CALLBACK_CHANGE_MODE_POLL_FD:
case LWS_CALLBACK_LOCK_POLL:
return rc;
#else
/*
* callbacks for managing the external poll() array appear in
* protocol 0 callback
*/
case LWS_CALLBACK_ADD_POLL_FD:
if (jsi_wsnum_pollfds >= max_poll_elements) {
lwsl_err("LWS_CALLBACK_ADD_POLL_FD: too many sockets to track\n");
return 1;
}
fd_lookup[fd] = jsi_wsnum_pollfds;
jsi_wspollfds[jsi_wsnum_pollfds].fd = fd;
jsi_wspollfds[jsi_wsnum_pollfds].events = (int)(long)len;
jsi_wspollfds[jsi_wsnum_pollfds++].revents = 0;
break;
case LWS_CALLBACK_DEL_POLL_FD:
if (!--jsi_wsnum_pollfds)
break;
m = fd_lookup[fd];
/* have the last guy take up the vacant slot */
jsi_wspollfds[m] = jsi_wspollfds[jsi_wsnum_pollfds];
fd_lookup[jsi_wspollfds[jsi_wsnum_pollfds].fd] = m;
break;
#endif
default:
deflt = 1;
break;
}
if (deflt && cmdPtr->debug>16 && cmdPtr->debug<128) {
fprintf(stderr, "HTTP CALLBACK: len=%d, %p %d:%s\n", (int)len, user, reason, jsw_getReasonStr(reason));
}
switch (reason) {
case LWS_CALLBACK_WSI_DESTROY:
break;
#if (LWS_LIBRARY_VERSION_MAJOR>1)
// Handle GET file download in client mode.
case LWS_CALLBACK_RECEIVE_CLIENT_HTTP: {
char buffer[1024 + LWS_PRE];
char *px = buffer + LWS_PRE;
int lenx = sizeof(buffer) - LWS_PRE;
if (lws_http_client_read(wsi, &px, &lenx) < 0)
return -1;
break;
}
case LWS_CALLBACK_RECEIVE_CLIENT_HTTP_READ:
if (jsi_wsrecv_callback(interp, cmdPtr, pss, inPtr, len, 0) != JSI_OK)
rc = 1;
break;
case LWS_CALLBACK_COMPLETED_CLIENT_HTTP:
if (jsi_wsrecv_callback(interp, cmdPtr, pss, inPtr, len, 1) != JSI_OK)
rc = 1;
break;
case LWS_CALLBACK_CLIENT_APPEND_HANDSHAKE_HEADER:
if (cmdPtr->post) {
unsigned char **p = (unsigned char **)in, *end = (*p) + len;
int n = 0;
char buf[JSI_MAX_NUMBER_STRING];
Jsi_ValueString(interp, cmdPtr->post, &n);
snprintf(buf, sizeof(buf), "%d", n);
if (lws_add_http_header_by_token(wsi,
WSI_TOKEN_HTTP_CONTENT_LENGTH,
(unsigned char *)buf, 2, p, end))
return -1;
if (lws_add_http_header_by_token(wsi,
WSI_TOKEN_HTTP_CONTENT_TYPE,
(unsigned char *)"application/x-www-form-urlencoded", 33, p, end))
return -1;
/* inform lws we have http body to send */
lws_client_http_body_pending(wsi, 1);
lws_callback_on_writable(wsi);
}
break;
case LWS_CALLBACK_CLIENT_HTTP_WRITEABLE: {
int n = 0;
char *cps = Jsi_ValueString(interp, cmdPtr->post, &n);
char *buf = (char*)Jsi_Calloc(1, LWS_PRE + n + 1);
Jsi_Strcpy(buf + LWS_PRE, cps);
n = lws_write(wsi, (unsigned char *)&buf[LWS_PRE], strlen(&buf[LWS_PRE]), LWS_WRITE_HTTP);
Jsi_Free(buf);
if (n < 0)
return -1;
/* we only had one thing to send, so inform lws we are done
* if we had more to send, call lws_callback_on_writable(wsi);
* and just return 0 from callback. On having sent the last
* part, call the below api instead.*/
lws_client_http_body_pending(wsi, 0);
break;
}
#endif
case LWS_CALLBACK_FILTER_NETWORK_CONNECTION:
break;
case LWS_CALLBACK_PROTOCOL_INIT:
break;
case LWS_CALLBACK_CLOSED_HTTP:
if (cmdPtr->debug>2)
fprintf(stderr, "CLOSED\n");
if (!pss)
pss = jsi_wsgetPss(cmdPtr, wsi, user, 0, 1);
if (pss)
jsi_wsdeletePss(pss);
break;
case LWS_CALLBACK_WSI_CREATE:
break;
case LWS_CALLBACK_CONFIRM_EXTENSION_OKAY:
break;
case LWS_CALLBACK_FILTER_HTTP_CONNECTION:
if (cmdPtr->debug>1)
fprintf(stderr, "FILTER CONNECTION: %s\n", inPtr);
pss = jsi_wsgetPss(cmdPtr, wsi, user, 1, 1);
Jsi_DSSet(&pss->url, inPtr);
jsi_wsgetUriArgValue(interp, wsi, &pss->query, &pss->queryObj);
if (cmdPtr->instCtx == context && (cmdPtr->clientName[0] || cmdPtr->clientIP[0])) {
pss->clientName = cmdPtr->clientName;
pss->clientIP = cmdPtr->clientIP;
}
Jsi_DSSetLength(&pss->dHdrs, 0);
pss->hdrNum = jsi_wsGetHeaders(pss, wsi, &pss->dHdrs, pss->hdrSz, sizeof(pss->hdrSz)/sizeof(int));
if (cmdPtr->onFilter && !cmdPtr->deleted) {
// 4 args: ws, id, url, bool
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, 1);
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", pss);
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_SERVER_NEW_CLIENT_INSTANTIATED:
client_name[0] = 0;
client_ip[0] = 0;
lws_get_peer_addresses(wsi, lws_get_socket_fd(wsi), client_name,
sizeof(client_name), client_ip, sizeof(client_ip));
if (client_name[0])
cmdPtr->clientName = Jsi_KeyAdd(interp, client_name);
if (client_ip[0])
cmdPtr->clientIP = Jsi_KeyAdd(interp, client_ip);
if (cmdPtr->clientName || cmdPtr->clientIP) {
const char *loname = cmdPtr->localhostName;
if (!loname) loname = "localhost";
cmdPtr->instCtx = context;
if (cmdPtr->debug>1)
fprintf(stderr, "Received network connect from %s (%s)\n",
cmdPtr->clientName, cmdPtr->clientIP);
#ifndef __WIN32
if (cmdPtr->local && (cmdPtr->clientName && Jsi_Strcmp(cmdPtr->clientName, loname))) {
if (cmdPtr->debug>1)
fprintf(stderr, "Dropping non-localhost connection\n");
return 1;
}
#endif
}
if (cmdPtr->maxConnects && cmdPtr->stats.connectCnt>=cmdPtr->maxConnects) {
if (cmdPtr->debug>1)
fprintf(stderr, "maxConnects exceeded: rejecting connection <%p>\n", user);
rc = -1;
}
/* if we returned non-zero from here, we kill the connection */
break;
case LWS_CALLBACK_HTTP:
{
Jsi_DString dStr;
Jsi_DSInit(&dStr);
if (cmdPtr->debug)
fprintf(stderr, "HTTP GET: %s\n", inPtr);
rc = jsi_wsHttp(interp, cmdPtr, wsi, user, context, inPtr, &dStr, pss);
Jsi_DSFree(&dStr);
if (rc<0)
return -1;
if (rc==1) {
goto try_to_reuse;
}
break;
}
#if (LWS_LIBRARY_VERSION_MAJOR>1)
case LWS_CALLBACK_HTTP_BODY: {
if (!pss)
pss = jsi_wsgetPss(cmdPtr, wsi, user, 0, 1);
if (!pss) break;
callPtr = (pss->onUpload?pss->onUpload:cmdPtr->onUpload);
if (cmdPtr->maxUpload<=0 || !callPtr) {
if (cmdPtr->noWarn==0)
fprintf(stderr, "Upload disabled: maxUpload=%d, onUpload=%p\n", cmdPtr->maxUpload, callPtr);
return -1;
}
if (!pss->spa) {
/* create the POST argument parser */
if (!pss->paramv) {
if (cmdPtr->formParams && cmdPtr->formParams != jsi_wsparam_str)
Jsi_SplitStr(cmdPtr->formParams, &pss->paramc, &pss->paramv, ",", &pss->paramDS);
else {
pss->paramv = (typeof(pss->paramv))jsi_wsparam_names;
pss->paramc = ARRAY_SIZE(jsi_wsparam_names);
}
}
pss->spa = lws_spa_create(wsi, (const char*const*)pss->paramv,
pss->paramc, 4096, jsi_wsFileUploadCB, pss);
if (!pss->spa)
return -1;
pss->filename[0] = '\0';
pss->file_length = 0;
}
cmdPtr->stats.uploadLast = pss->stats.uploadLast = time(NULL);
/* let it parse the POST data */
if (lws_spa_process(pss->spa, inPtr, len))
return -1;
if (!pss->stats.uploadStart) {
cmdPtr->stats.uploadEnd = pss->stats.uploadEnd = 0;
cmdPtr->stats.uploadStart = pss->stats.uploadStart = time(NULL);
cmdPtr->stats.uploadCnt++;
pss->stats.uploadCnt++;
}
break;
}
case LWS_CALLBACK_HTTP_BODY_COMPLETION:
if (!pss) {
pss = jsi_wsgetPss(cmdPtr, wsi, user, 0, 1);
callPtr = (pss&&pss->onUpload?pss->onUpload:cmdPtr->onUpload);
}
if (pss && pss->spa)
lws_spa_finalize(pss->spa);
res = Jsi_DSValue(&pss->resultStr);
if (!res[0]) {
if (!pss->resultCode)
res = "<html><body>Upload complete</body></html>";
else
res = "<html><body>Upload error</body></html>";
}
jsi_wsServeString(pss, wsi, res, pss->resultCode==JSI_OK?0:500, NULL, NULL);
if (cmdPtr->maxUpload<=0 || !callPtr) {
if (cmdPtr->noWarn==0)
fprintf(stderr, "Upload disabled: maxUpload=%d, onUpload=%p\n", cmdPtr->maxUpload, callPtr);
return -1;
}
cmdPtr->stats.uploadEnd = pss->stats.uploadEnd = time(NULL);
lws_return_http_status(wsi, HTTP_STATUS_OK, NULL);
goto try_to_reuse;
case LWS_CALLBACK_HTTP_DROP_PROTOCOL:
pss = jsi_wsgetPss(cmdPtr, wsi, user, 0, 1);
if (pss && pss->spa) {
lws_spa_destroy(pss->spa);
pss->spa = NULL;
}
break;
#endif
case LWS_CALLBACK_HTTP_FILE_COMPLETION:
goto try_to_reuse;
case LWS_CALLBACK_HTTP_WRITEABLE: {
lwsl_info("LWS_CALLBACK_HTTP_WRITEABLE\n");
if (!pss)
pss = jsi_wsgetPss(cmdPtr, wsi, user, 0, 1);
if (!pss || !pss->fop_fd)
goto try_to_reuse;
/*
* we can send more of whatever it is we were sending
*/
int sent = 0;
unsigned char buffer[JSI_BUFSIZ*10 + LWS_PRE];
do {
int n = sizeof(buffer) - LWS_PRE;
int m = lws_get_peer_write_allowance(wsi);
if (m == 0)
goto later;
if (m != -1 && m < n)
n = m;
lws_filepos_t amount = 0;
n = lws_vfs_file_read(pss->fop_fd, &amount, buffer + LWS_PRE, n);
if (n < 0) {
lwsl_err("problem reading file\n");
goto bail;
}
n = (int)amount;
if (n == 0)
goto penultimate;
/*
* To support HTTP2, must take care about preamble space
*
* identification of when we send the last payload frame
* is handled by the library itself if you sent a
* content-length header
*/
m = jsi_wswrite(pss, wsi, buffer + LWS_PRE, n, LWS_WRITE_HTTP);
if (m < 0) {
lwsl_err("write failed\n");
/* write failed, close conn */
goto bail;
}
if (m) /* while still active, extend timeout */
lws_set_timeout(wsi, PENDING_TIMEOUT_HTTP_CONTENT, 5);
sent += m;
} while (!lws_send_pipe_choked(wsi) && (sent < 500 * 1024 * 1024));
later:
lws_callback_on_writable(wsi);
break;
penultimate:
lws_vfs_file_close(&pss->fop_fd);
goto try_to_reuse;
bail:
lws_vfs_file_close(&pss->fop_fd);
rc = -1;
goto doret;
}
default:
break;
}
goto doret;
try_to_reuse:
if (lws_http_transaction_completed(wsi))
rc = -1;
else
rc = 0;
goto doret;
doret:
if (cmdPtr->debug>2)
fprintf(stderr, "<---HTTP RET = %d\n", rc);
return rc;
} | 269,743,472,377,777,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,449 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | RebuildTable(Jsi_Hash *tablePtr)
{
Jsi_HashEntry **bucketPtr, **oldBuckets;
Jsi_HashEntry **oldChainPtr, **endPtr;
Jsi_HashEntry *hPtr, *nextPtr;
size_t hindex;
oldBuckets = tablePtr->buckets;
endPtr = tablePtr->buckets + tablePtr->numBuckets;
tablePtr->numBuckets <<= 2;
tablePtr->buckets = (Jsi_HashEntry**)Jsi_Calloc(tablePtr->numBuckets,
sizeof(Jsi_HashEntry *));
tablePtr->rebuildSize <<= 2;
tablePtr->downShift -= 2;
tablePtr->mask = tablePtr->numBuckets - 1;
if (tablePtr->keyType == JSI_KEYS_ONEWORD) {
for (oldChainPtr = oldBuckets; oldChainPtr < endPtr; oldChainPtr++) {
for (hPtr = *oldChainPtr; hPtr != NULL; hPtr = nextPtr) {
nextPtr = hPtr->nextPtr;
hindex = RANDOM_INDEX(tablePtr, hPtr->key.oneWordValue);
bucketPtr = tablePtr->buckets + hindex;
hPtr->nextPtr = *bucketPtr;
*bucketPtr = hPtr;
}
}
} else {
for (oldChainPtr = oldBuckets; oldChainPtr < endPtr; oldChainPtr++) {
for (hPtr = *oldChainPtr; hPtr != NULL; hPtr = nextPtr) {
nextPtr = hPtr->nextPtr;
hindex = hPtr->hval & tablePtr->mask;
bucketPtr = tablePtr->buckets + hindex;
hPtr->nextPtr = *bucketPtr;
*bucketPtr = hPtr;
}
}
}
if (oldBuckets != tablePtr->staticBuckets) {
Jsi_Free(oldBuckets);
}
} | 107,825,776,002,353,380,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,450 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_NumberIsFinite(Jsi_Number value)
{
Jsi_Number r = INFINITY;
return (Jsi_NumberIsNaN(value)==0 && value != r && r != -value);
} | 308,733,554,278,667,940,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,451 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_GetLongFromValue(Jsi_Interp* interp, Jsi_Value *value, long *n)
{
/* TODO: inefficient to convert to double then back. */
if (!value)
return JSI_ERROR;
if (!interp->strict)
jsi_ValueToOInt32(interp, value);
if (!Jsi_ValueIsNumber(interp, value))
return Jsi_LogError("invalid number");
*n = (long)(value->vt == JSI_VT_NUMBER ? value->d.num : value->d.obj->d.num);
return JSI_OK;
} | 248,171,782,849,636,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,452 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueToString(Jsi_Interp *interp, Jsi_Value *v, int *lenPtr)
{
Jsi_Number d;
const char *ntxt = "undefined";
int kflag = 1;
int isKey = 0;
char *key = NULL;
if (!v)
goto done;
if (lenPtr) *lenPtr = 0;
char unibuf[JSI_MAX_NUMBER_STRING*2];
switch(v->vt) {
case JSI_VT_STRING:
ntxt = v->d.s.str;
goto done;
case JSI_VT_UNDEF:
break;
case JSI_VT_BOOL:
ntxt = v->d.val ? "true":"false";
break;
case JSI_VT_NULL:
ntxt = "null";
break;
case JSI_VT_NUMBER: {
d = v->d.num;
fmtnum:
if (Jsi_NumberIsInteger(d)) {
Jsi_NumberItoA10((Jsi_Wide)d, unibuf, sizeof(unibuf));
kflag = 0;
ntxt = unibuf;
} else if (Jsi_NumberIsNormal(d)) {
Jsi_NumberDtoA(interp, d, unibuf, sizeof(unibuf), 0);
kflag = 0;
ntxt = unibuf;
} else if (Jsi_NumberIsNaN(v->d.num)) {
ntxt = "NaN";
} else {
int s = Jsi_NumberIsInfinity(d);
if (s > 0) ntxt = "Infinity";
else if (s < 0) ntxt = "-Infinity";
else Jsi_LogBug("Ieee function got problem");
}
break;
}
case JSI_VT_OBJECT: {
Jsi_Obj *obj = v->d.obj;
switch(obj->ot) {
case JSI_OT_STRING:
ntxt = obj->d.s.str;
goto done;
case JSI_OT_BOOL:
ntxt = obj->d.val ? "true":"false";
break;
case JSI_OT_NUMBER:
d = obj->d.num;
goto fmtnum;
break;
default:
ntxt = "[object Object]";
break;
}
break;
}
default:
Jsi_LogBug("Convert a unknown type: 0x%x to string", v->vt);
break;
}
Jsi_ValueReset(interp, &v);
if (!kflag) {
Jsi_ValueMakeStringDup(interp, &v, ntxt);
return Jsi_ValueString(interp, v, lenPtr);
}
key = jsi_KeyFind(interp, ntxt, 0, &isKey);
if (key)
Jsi_ValueMakeStringKey(interp, &v, key);
else
Jsi_ValueMakeString(interp, &v, ntxt);
ntxt = v->d.s.str;
done:
if (lenPtr) *lenPtr = Jsi_Strlen(ntxt);
return ntxt;
} | 87,963,425,502,435,620,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,453 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 StringSearchCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
int sLen, bLen;
const char *source_str;
ChkString(_this, funcPtr, source_str, &sLen, &bLen);
char *v = _this->d.obj->d.s.str;
Jsi_Value *seq = Jsi_ValueArrayIndex(interp, args, skip);
if (Jsi_ValueIsString(interp, seq)) {
char *ce, *cp = Jsi_ValueString(interp, seq, NULL);
int n = -1;
if ((ce = Jsi_Strstr(source_str, cp))) {
n = (ce-source_str);
}
Jsi_ValueMakeNumber(interp, ret, n);
return JSI_OK;
}
if (!seq || seq->vt != JSI_VT_OBJECT || seq->d.obj->ot != JSI_OT_REGEXP) {
Jsi_ValueMakeNumber(interp, ret, -1);
return JSI_OK;
}
regex_t *reg = &seq->d.obj->d.robj->reg;
regmatch_t pos[MAX_SUBREGEX] = {};
int r;
if ((r = regexec(reg, v, MAX_SUBREGEX, pos, 0)) != 0) {
if (r == REG_NOMATCH) {
Jsi_ValueMakeNumber(interp, ret, -1.0);
return JSI_OK;
}
if (r >= REG_BADPAT) {
char buf[JSI_MAX_NUMBER_STRING];
regerror(r, reg, buf, sizeof(buf));
Jsi_LogError("error while matching pattern: %s", buf);
return JSI_ERROR;
}
}
Jsi_ValueMakeNumber(interp, ret, (Jsi_Number)pos[0].rm_so);
return JSI_OK;
} | 105,005,813,206,958,480,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,454 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ArgTypeCheck(Jsi_Interp *interp, int typ, Jsi_Value *arg, const char *p1,
const char *p2, int index, Jsi_Func *func, bool isdefault) {
Jsi_RC rc = JSI_OK;
char idxBuf[JSI_MAX_NUMBER_STRING*2];
idxBuf[0] = 0;
if (func && arg->vt == JSI_VT_UNDEF && !interp->typeCheck.noundef && index>0 && !isdefault && !(typ&JSI_TT_UNDEFINED)) {
snprintf(idxBuf, sizeof(idxBuf), " arg %d", index);
jsi_TypeMismatch(interp);
Jsi_DString fStr = {};
rc = Jsi_LogType("call with undefined var %s%s '%s'%s", p1, idxBuf, p2, jsiFuncInfo(interp, &fStr, func, arg));
Jsi_DSFree(&fStr);
return rc;
}
if (typ <= 0)
return JSI_OK;
//if (typ&JSI_TT_VOID)
// return JSI_OK;
if (interp->typeCheck.all==0) {
if (func ? (interp->typeCheck.run==0) : (interp->typeCheck.parse==0))
return JSI_OK;
}
if (index == 0 && func && func->type == FC_BUILDIN &&
interp->typeCheck.all == 0) // Normally do not check return types for builtins.
return JSI_OK;
if ((typ&JSI_TT_ANY)) return JSI_OK;
if (index == 0 && arg->vt == JSI_VT_UNDEF) {
if (!(typ&JSI_TT_VOID))
goto done;
return JSI_OK;
}
if (isdefault && index && typ&JSI_TT_VOID && arg->vt == JSI_VT_UNDEF)
return JSI_OK;
if (typ&JSI_TT_UNDEFINED && Jsi_ValueIsUndef(interp, arg)) return rc;
if (typ&JSI_TT_NUMBER && Jsi_ValueIsNumber(interp, arg)) return rc;
if (typ&JSI_TT_STRING && Jsi_ValueIsString(interp, arg)) return rc;
if (typ&JSI_TT_BOOLEAN && Jsi_ValueIsBoolean(interp, arg)) return rc;
if (typ&JSI_TT_ARRAY && Jsi_ValueIsArray(interp, arg)) return rc;
if (typ&JSI_TT_FUNCTION && Jsi_ValueIsFunction(interp, arg)) return rc;
if (typ&JSI_TT_REGEXP && Jsi_ValueIsObjType(interp, arg, JSI_OT_REGEXP)) return rc;
if (typ&JSI_TT_USEROBJ && Jsi_ValueIsObjType(interp, arg, JSI_OT_USEROBJ)) return rc;
if (typ&JSI_TT_ITEROBJ && Jsi_ValueIsObjType(interp, arg, JSI_OT_ITER)) return rc;
if (typ&JSI_TT_OBJECT && (
Jsi_ValueIsObjType(interp, arg, JSI_OT_OBJECT) && Jsi_ValueIsArray(interp, arg)==0))
return rc;
if (typ&JSI_TT_NULL && Jsi_ValueIsNull(interp, arg)) return rc;
done:
{
Jsi_DString dStr = {};
const char *exp = jsi_typeName(interp, typ, &dStr);
const char *vtyp = jsi_ValueTypeName(interp, arg);
if (index>0)
snprintf(idxBuf, sizeof(idxBuf), " arg %d", index);
if (interp->typeCheck.error)
rc = JSI_ERROR;
jsi_TypeMismatch(interp);
Jsi_DString fStr = {};
rc = Jsi_LogType("type mismatch %s%s '%s': expected \"%s\" but got \"%s\"%s",
p1, idxBuf, p2, exp, vtyp, jsiFuncInfo(interp, &fStr, func, arg));
Jsi_DSFree(&fStr);
Jsi_DSFree(&dStr);
}
return rc;
} | 38,594,923,720,576,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,455 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_wswrite(jsi_wsPss* pss, struct lws *wsi, unsigned char *buf, int len, enum lws_write_protocol proto)
{
jsi_wsCmdObj *cmdPtr = pss->cmdPtr;
int m = lws_write(wsi, buf, len, proto);
if (m >= 0) {
cmdPtr->stats.sentCnt++;
cmdPtr->stats.sentLast = time(NULL);
pss->stats.sentCnt++;
pss->stats.sentLast = time(NULL);
} else {
pss->state = PWS_SENDERR;
pss->stats.sentErrCnt++;
pss->stats.sentErrLast = time(NULL);
cmdPtr->stats.sentErrCnt++;
cmdPtr->stats.sentErrLast = time(NULL);
}
return m;
} | 110,385,768,558,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,456 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueAssignCheck(Jsi_Interp *interp, Jsi_Value *val, int lop) {
if (lop == OP_FCALL || lop == OP_NEWFCALL)
return JSI_OK;
if (val->f.bits.lookupfailed && val->d.lookupFail)
return Jsi_LogType("assign from undef var: %s", val->d.lookupFail);
return JSI_OK;
} | 313,244,160,212,931,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,457 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 InterpUplevelCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
return InterpEvalCmd_(interp, args, _this, ret, funcPtr, 1);
} | 3,258,100,613,659,075,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,458 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 mdbPrepareStmt(MyDbEvalContext *p)
{
MySqlObj *jdb = p->jdb;
//int namedParams = !jdb->optPtr->noNamedParams;
const char *zSql = p->zSql; /* Pointer to first SQL statement in zIn */
MYSQL_STMT *myStmt; /* Prepared statement object */
MysqlPrep *prep = 0; /* Pointer to cached statement */
Jsi_RC rc = JSI_OK;
Jsi_Interp *interp = jdb->interp;
Jsi_HashEntry *entry = Jsi_HashEntryFind(jdb->stmtHash, zSql);
if (entry && ((prep = (MysqlPrep*)Jsi_HashValueGet(entry)))) {
if (jdb->debug & mdbTMODE_PREPARE)
JSI_DBQUERY_PRINTF( "DEBUG: prepare cache-hit: %s\n", zSql);
myStmt = prep->myStmt;
/* 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, prep->elPtr);
jdb->numStmts = Jsi_ListSize(jdb->stmtCache);
// Sanity check for schema check: right now we just use number of columns
if (prep->numCol != (int)mysql_stmt_field_count(prep->myStmt)) {
mdbRelease1Stmt(jdb, prep);
prep = NULL;
}
}
/* If no prepared statement was found. Compile the SQL text. Also allocate
** a new MysqlPrep structure. */
if (!prep) {
myStmt = mysql_stmt_init(jdb->db);
if (!myStmt)
return Jsi_LogError("can't get statement: %s", mysql_error(jdb->db));
char **paramNames;
int paramCnt;
int namedParams = 0;
Jsi_DString *naStr = NULL;
if (p->namedParams)
{
Jsi_RC rc = JSI_OK;
Jsi_DString nsStr, nnStr;
Jsi_DSInit(&nsStr);
Jsi_DSInit(&nnStr);
if (MySqlExtractParmNames(jdb, zSql, &nsStr, &nnStr) != JSI_OK)
rc = Jsi_LogError("parsing names from query: %s", zSql);
else if (Jsi_DSLength(&nnStr)) {
namedParams = 1;
zSql = Jsi_DSFreeDup(&nsStr);
naStr = (Jsi_DString*)Jsi_Calloc(1, sizeof(*naStr));
Jsi_SplitStr(Jsi_DSValue(&nnStr), ¶mCnt, ¶mNames, " ", naStr);
}
Jsi_DSFree(&nsStr);
Jsi_DSFree(&nnStr);
if (rc != JSI_OK)
return rc;
}
if (mysql_stmt_prepare(myStmt, zSql, Jsi_Strlen(zSql)) )
{
Jsi_LogError("error in sql: %s", mysql_error(jdb->db));
mysql_stmt_close(myStmt);
if (namedParams) {
Jsi_DSFree(naStr);
Jsi_Free(naStr);
Jsi_Free((char*)zSql);
}
return JSI_ERROR;
}
if (jdb->debug & mdbTMODE_PREPARE)
JSI_DBQUERY_PRINTF( "DEBUG: prepare new: %s\n", zSql);
assert( prep==0 );
prep = (MysqlPrep*)Jsi_Calloc(1, sizeof(MysqlPrep));
jdb->numStmts++;
prep->sig = MYSQL_SIG_STMT;
prep->myStmt = myStmt;
if (!namedParams)
prep->zSql = Jsi_Strdup(zSql);
else {
prep->zSql = (char*)zSql;
prep->origSql = Jsi_Strdup(p->zSql);
prep->naStr = naStr;
prep->paramCnt = paramCnt;
prep->paramNames = paramNames;
}
prep->paramMetaData = mysql_stmt_param_metadata(myStmt);
prep->resultMetaData = mysql_stmt_result_metadata(myStmt);
prep->numCol = mysql_stmt_field_count(myStmt);
if (prep->numCol>0)
prep->bindResult = (MYSQL_BIND *)Jsi_Calloc(prep->numCol, sizeof(MYSQL_BIND));
prep->numParam = mysql_stmt_param_count(myStmt);
if (prep->numParam>0 && !prep->bindParam) {
prep->bindParam = (MYSQL_BIND *)Jsi_Calloc(prep->numParam, sizeof(MYSQL_BIND));
prep->fieldParam = (SqlFieldResults*)Jsi_Calloc(prep->numParam, sizeof(*prep->fieldParam));
}
bool isNew = 0;
prep->entry = Jsi_HashEntryNew(jdb->stmtHash, p->zSql, &isNew);
if (!isNew)
JSI_DBQUERY_PRINTF( "mysql dup stmt entry");
Jsi_HashValueSet(prep->entry, prep);
}
p->prep = prep;
return rc;
} | 10,973,779,313,597,720,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,459 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 jsiVarDeref(Jsi_Interp* interp, int n) {
while(interp->framePtr->Sp<n) // Assert and Log may map-out Ops.
jsiPush(interp, 1);
int i;
for (i=1; i<=n; i++) {
Jsi_Value *vb = _jsi_STACKIDX(interp->framePtr->Sp - i);
if (vb->vt == JSI_VT_VARIABLE) {
SIGASSERTV(vb->d.lval, VALUE);
Jsi_ValueCopy(interp, vb, vb->d.lval);
}
}
} | 149,200,788,175,919,920,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,460 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_NumberIsSafeInteger(Jsi_Number n) {
Jsi_Number n1 = fabsl(n),
n2 = 9007199254740991LL;
return (Jsi_NumberIsInteger(n) && n1<=n2);
} | 57,722,722,418,649,380,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,461 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 char *FindEndB(char *cp) {
if (*cp == '\"'||*cp == '\'') {
char endc = *cp;
cp++;
while (*cp && *cp != endc) {
if (*cp == '\\' && cp[1]) cp++;
cp++;
}
if (*cp == endc)
cp++;
if (*cp != ']')
return NULL;
return cp;
} else
return Jsi_Strchr(cp, ']');
} | 205,597,831,962,055,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,462 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 MySqlCompleteCmd(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;
Jsi_Value *s = Jsi_ValueArrayIndex(interp, args, 0);
const char *str = Jsi_ValueString(interp, s, NULL);
int isComplete = 0;
if (str)
isComplete = 0; // sqlite3_complete( str );
Jsi_ValueMakeBool(interp, ret, isComplete);
return JSI_OK;
} | 4,478,571,106,509,492,500,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,463 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueDebugUpdate_(Jsi_Interp *interp, jsi_ValueDebug *vd, void *v, Jsi_Hash* tbl, const char *fname, int line, const char *func)
{
vd->fname = fname;
vd->line = line;
vd->func = func;
if (!vd->Idx)
vd->Idx = interp->dbPtr->memDebugCallIdx;
vd->hPtr = Jsi_HashSet(tbl, v, 0);
vd->ip = interp->curIp;
if (vd->ip) {
vd->ipLine = vd->ip->Line;
vd->ipOp = vd->ip->op;
vd->ipFname = vd->ip->fname;
}
vd->interp = interp;
if (jsi_memDebugBreakIdx && jsi_memDebugBreakIdx == vd->Idx)
jsi_memDebugBreak();
} | 257,263,144,027,227,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,464 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ParentFuncFree(Jsi_Interp *interp, Jsi_OptionSpec* spec, void *ptr)
{
Jsi_Value **v = (Jsi_Value **)(((char*)ptr));
if (!interp->parent) return;
if (*v)
Jsi_DecrRefCount(interp->parent, *v);
*v = NULL;
} | 311,623,790,244,121,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,465 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_fromHexChar(char ch) {
return isdigit(ch) ? ch - '0' : tolower(ch) - 'a' + 10;
} | 13,819,188,219,365,819,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,466 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 mdbOutputHtmlString(QueryOpts *p, const char *z, Jsi_DString *dStr)
{
while( *z ) {
switch (*z) {
case '<':
Jsi_DSAppend(dStr, "<", NULL);
break;
case '>':
Jsi_DSAppend(dStr, ">", NULL);
break;
case '&':
Jsi_DSAppend(dStr, "&", NULL);
break;
case '\"':
Jsi_DSAppend(dStr, """, NULL);
break;
case '\'':
Jsi_DSAppend(dStr, "'", NULL);
break;
default:
Jsi_DSAppendLen(dStr, z, 1);
break;
}
z++;
}
} | 27,055,030,089,948,254,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,467 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueIsType(Jsi_Interp *interp, Jsi_Value *pv, Jsi_vtype vtype) {
if (!pv) return 0;
return pv->vt == vtype;
} | 179,455,042,968,166,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,468 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueGetStringLen(Jsi_Interp *interp, Jsi_Value *pv, int *lenPtr)
{
if (!pv)
return NULL;
Jsi_String *s = jsi_ValueString(pv);
if (!s)
return NULL;
if (lenPtr)
*lenPtr = (s->len<0 ? (int)Jsi_Strlen(s->str) : s->len);
return s->str;
} | 265,620,742,650,234,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,469 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 *ValueNew(Jsi_Interp *interp)
{
interp->dbPtr->valueCnt++;
interp->dbPtr->valueAllocCnt++;
Jsi_Value *v = (Jsi_Value *)Jsi_Calloc(1,sizeof(*v));
SIGINIT(v,VALUE)
v->vt = JSI_VT_UNDEF;
jsi_DebugValue(v,"New", jsi_DebugValueCallIdx(), interp);
return v;
} | 51,531,948,313,671,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,470 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 MySqlResetCmd(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;
#if (MYSQL_VERSION_ID >= 50703 && !defined(JSI_NO_MYSQL_RESET))
int oldMax = jdb->maxStmts;
jdb->maxStmts = 0;
mdbStmtLimit(jdb);
jdb->maxStmts = oldMax;
Jsi_ValueMakeNumber(interp, ret, (Jsi_Number)mysql_reset_connection(jdb->db));
#else
Jsi_LogWarn("mysql reset unavailable: requires version 5.7.3+");
#endif
return JSI_OK;
} | 272,639,625,549,137,430,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,471 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ListDelete(Jsi_List *list) {
Jsi_ListClear(list);
free(list);
} | 42,922,013,603,167,920,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,472 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_SetOption(Jsi_Interp *interp, Jsi_OptionSpec *specPtr, const char *string /*UNUSED*/, void* rec, Jsi_Value *argValue, Jsi_Wide flags, bool isSafe)
{
Jsi_Value *oa = interp->lastParseOpt;
interp->lastParseOpt = argValue;
Jsi_RC rc = jsi_SetOption_(interp, specPtr, string, rec, argValue, flags, isSafe);
interp->lastParseOpt = oa;
return rc;
} | 69,280,185,630,606,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,473 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ArgsOptAdd(jsi_Pstate *pstate, Jsi_ScopeStrs *a)
{
jsi_PstatePush(pstate);
return a;
} | 121,110,897,087,818,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,474 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_DbKeyAdd(Jsi_Db *jdb, const char *str)
{
#ifndef JSI_LITE_ONLY
if (jdb->interp)
return Jsi_KeyAdd(jdb->interp, str);
#endif
Jsi_HashEntry *hPtr;
bool isNew;
hPtr = Jsi_HashEntryNew(jdb->strKeyTbl, str, &isNew);
assert(hPtr) ;
return (const char*)Jsi_HashKeyGet(hPtr);
} | 59,159,214,849,012,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,475 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueToOInt32(Jsi_Interp *interp, Jsi_Value *v)
{
Jsi_Number a = Jsi_ValueToNumberInt(interp, v, 1);
Jsi_ValueReset(interp,&v);
Jsi_ValueMakeNumber(interp, &v, a);
return (int)a;
} | 304,627,605,275,509,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,476 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueDup(Jsi_Interp *interp, Jsi_Value *ov, const char *fname, int line, const char *func) {
Jsi_Value *v = ValueDup(interp, ov);
jsi_ValueDebugUpdate(interp, v, valueDebugTbl, fname, line, func);
return v;
} | 152,496,900,091,217,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,477 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_top() { JSI_NEW_CODES(0,OP_PUSHTOP, 0); } | 147,640,212,995,721,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,478 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_FSFlushProc(Jsi_Channel chan) { return fflush(_JSI_GETFP(chan,0));} | 167,708,732,859,528,320,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,479 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_RunFuncCallCheck(Jsi_Interp *interp, Jsi_Func *func, int argc, const char *name, jsi_Pline *line, Jsi_OpCodes *argCodes, bool isParse)
{
Jsi_RC rc = JSI_OK;
if (interp->typeCheck.all==0) {
if (!argCodes ? (interp->typeCheck.run==0) : (interp->typeCheck.parse==0))
return JSI_OK;
}
Jsi_CmdSpec *spec = func->cmdSpec;
Jsi_ScopeStrs *ss = func->argnames;
if (ss==NULL && spec == NULL)
return JSI_OK;
int i, minArgs, maxArgs, mis = 0, varargs = 0;
char nbuf[JSI_MAX_NUMBER_STRING];
if (func->type == FC_BUILDIN) {
varargs = (spec->maxArgs<0);
maxArgs = spec->maxArgs + func->callflags.bits.addargs;
minArgs = spec->minArgs + func->callflags.bits.addargs;
} else {
varargs = ss->varargs;
minArgs = (ss->firstDef>0 ? ss->firstDef-1 : ss->count);
maxArgs = ss->count;
mis = (argc != ss->count);
if (func->retType == 0 && ss && ss->typeCnt == 0 && interp->typeCheck.all==0)
return JSI_OK;
}
if (varargs) {
if (argc >= minArgs)
return JSI_OK;
mis = (argc<minArgs);
} else
mis = (argc<minArgs || argc>maxArgs);
if (mis) {
if (varargs)
snprintf(nbuf, sizeof(nbuf), "%d or more", minArgs);
else if (maxArgs > minArgs)
snprintf(nbuf, sizeof(nbuf), "%d-%d", minArgs, maxArgs);
else
snprintf(nbuf, sizeof(nbuf), "%d", maxArgs);
if (line)
interp->parseLine = line;
if (interp->typeCheck.error)
rc = JSI_ERROR;
Jsi_DString dStr = {};
Jsi_FuncObjToString(interp, func, &dStr, 2);
if (isParse)
Jsi_LogWarn("got %d args, expected %s, calling %s", argc, nbuf, Jsi_DSValue(&dStr));
else
rc = Jsi_LogType("got %d args, expected %s, calling %s", argc, nbuf, Jsi_DSValue(&dStr));
jsi_TypeMismatch(interp);
Jsi_DSFree(&dStr);
if (line)
interp->parseLine = NULL;
return rc;
}
if (argCodes && argCodes->code_len>=argc) {
int cl = argCodes->code_len;
int aind=argc-1;
for (i=cl-1; rc == JSI_OK && i>=0 && aind>=0; i--,aind--) {
Jsi_ttype atyp = JSI_TT_ANY;
switch (argCodes->codes[i].op) {
case OP_PUSHSTR: atyp=JSI_TT_STRING; break;
case OP_PUSHNUM: atyp=JSI_TT_NUMBER; break;
case OP_PUSHBOO: atyp=JSI_TT_BOOLEAN; break;
case OP_PUSHFUN: atyp=JSI_TT_FUNCTION; break;
case OP_PUSHTHS: atyp=JSI_TT_OBJECT; break;
case OP_PUSHREG: atyp=JSI_TT_REGEXP; break;
case OP_PUSHUND: atyp=JSI_TT_VOID; break;
case OP_PUSHNULL: atyp=JSI_TT_NULL; break;
case OP_PUSHARG: atyp=JSI_TT_ARRAY; break;
case OP_SUBSCRIPT: i++; break;
case OP_ARRAY: atyp=JSI_TT_ARRAY; i=jsiPopArgs(argCodes, i); break;
case OP_OBJECT: atyp=JSI_TT_OBJECT; i=jsiPopArgs(argCodes, i); break;
default: break;
}
if (atyp == JSI_TT_ANY) continue;
rc = jsi_StaticArgTypeCheck(interp, atyp, "for argument", name, aind+1, func, line);
}
}
return rc;
} | 116,708,772,761,867,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,480 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 SqliteExistsCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
Jsi_RC rc;
Jsi_Db *jdb;
if (!(jdb = dbGetDbHandle(interp, _this, funcPtr))) return JSI_ERROR;
Jsi_Value *vSql = Jsi_ValueArrayIndex(interp, args, 0);
const char *zSql;
Jsi_DString dStr = {};
DbEvalContext sEval = {};
zSql = Jsi_ValueGetDString(interp, vSql, &dStr, 0);
Jsi_DString sStr;
Jsi_DSInit(&sStr);
sEval.nocache = jdb->queryOpts.nocache;
if (dbEvalInit(interp, &sEval, jdb, zSql, &sStr, 0, 0) != JSI_OK)
return JSI_ERROR;
sEval.ret = *ret;
int cnt = 0;
if( JSI_OK==(rc = dbEvalStep(&sEval)) ) {
sqlite3_stmt *pStmt = sEval.pPreStmt->pStmt;
int nCol = sqlite3_column_count(pStmt);
if (nCol>0)
cnt++;
}
dbEvalFinalize(&sEval);
if( rc==JSI_BREAK ) {
rc = JSI_OK;
}
Jsi_DSFree(&dStr);
Jsi_ValueMakeBool(interp, ret, cnt);
return rc;
} | 199,590,835,612,078,770,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,481 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueMakeUndef(Jsi_Interp *interp, Jsi_Value **vPtr) {
Jsi_Value *v = (vPtr?*vPtr:NULL);
if (!v)
v = Jsi_ValueNew(interp);
else {
if (v->vt == JSI_VT_UNDEF) return v;
Jsi_ValueReset(interp, vPtr);
}
return v;
} | 99,192,364,488,948,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,482 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_SuboptFree(Jsi_Interp *interp, Jsi_OptionSpec* spec, void *ptr)
{
Jsi_OptionSpec *subspec = (Jsi_OptionSpec *)spec->data;
Jsi_OptionsFree(interp, subspec, ptr, 0);
} | 83,871,735,783,851,520,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,483 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static Jsi_RC MutexLock(Jsi_Interp *interp, Jsi_Mutex *mtx) {
int timeout = mtx->lockTimeout;
if (interp && timeout<0)
timeout = interp->lockTimeout;
if (timeout<=0)
pthread_mutex_lock(&mtx->mtx);
else {
struct timespec ts;
ts.tv_sec = timeout/1000;
ts.tv_nsec = 1000 * (timeout%1000);
int rc = pthread_mutex_timedlock(&mtx->mtx, &ts);
if (rc != 0) {
Jsi_LogError("lock timed out");
if (interp)
interp->threadErrCnt++;
mtx->threadErrCnt++;
return JSI_ERROR;
}
}
return JSI_OK;
} | 64,398,650,904,476,415,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,484 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_Wide Jsi_Seek(Jsi_Interp *interp, Jsi_Channel chan, Jsi_Wide offset, int mode) {
if (chan->fsPtr==0 || !chan->fsPtr->seekProc) return -1;
return chan->fsPtr->seekProc(chan, offset, mode);
} | 311,377,300,344,731,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,485 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 inline jsi_ValueAssign(Jsi_Interp *interp, Jsi_Value *dst, Jsi_Value* src, int lop)
{
Jsi_Value *v;
if (dst->vt != JSI_VT_VARIABLE) {
if (interp->strict)
return Jsi_LogError("operand not a left value");
} else {
v = dst->d.lval;
SIGASSERT(v, VALUE);
int strict = interp->strict;
if (strict && lop == OP_PUSHFUN && interp->curIp[-1].local)
dst->f.bits.local = 1;
if (strict && dst->f.bits.local==0) {
const char *varname = "";
if (v->f.bits.lookupfailed)
varname = v->d.lookupFail;
Jsi_RC rc = Jsi_LogType("function created global: \"%s\"", varname);
dst->f.bits.local=1;
if (rc != JSI_OK)
return rc;
}
if (v == src)
return JSI_OK;
if (v->f.bits.readonly) {
if (interp->strict)
return Jsi_LogError("assign to readonly variable");
return JSI_OK;
}
if (Jsi_ValueIsFunction(interp, src))
Jsi_ValueMove(interp,v, src);
else
Jsi_ValueCopy(interp,v, src);
SIGASSERT(v, VALUE);
v->f.bits.readonly = 0;
#ifdef JSI_MEM_DEBUG
if (!v->VD.label2)
v->VD.label2 = "ValueAssign";
#endif
}
return JSI_OK;
} | 331,287,591,096,613,660,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,486 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_MakeFuncValue(Jsi_Interp *interp, Jsi_CmdProc *callback, const char *name, Jsi_Value** toVal, Jsi_CmdSpec *cspec)
{
Jsi_Obj *o = Jsi_ObjNew(interp);
Jsi_Func *f = jsi_FuncNew(interp);
Jsi_ObjIncrRefCount(interp, o);
o->ot = JSI_OT_FUNCTION;
f->type = FC_BUILDIN;
f->callback = callback;
f->privData = NULL;
o->d.fobj = jsi_FuncObjNew(interp, f);
f->cmdSpec = cspec;
if (!cspec) {
f->cmdSpec = (Jsi_CmdSpec*)Jsi_Calloc(2,sizeof(Jsi_CmdSpec));
f->cmdSpec->reserved[3] = (void*)0x1;
f->cmdSpec->maxArgs = -1;
if (name)
f->cmdSpec->name = (char*)Jsi_KeyAdd(interp, name);
}
f->script = interp->curFile;
f->callback = callback;
return Jsi_ValueMakeObject(interp, toVal, o);
} | 91,465,073,650,909,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,487 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_HashArrayCreate( Jsi_Hash *tablePtr, const void *key, bool *newPtr)
{
jsi_Hash hval = jsi_HashArray(key, tablePtr->keyType);
size_t size, hindex = hval & tablePtr->mask;
Jsi_HashEntry *hPtr = tablePtr->buckets[hindex];
for (; hPtr != NULL; hPtr = hPtr->nextPtr)
if (hPtr->hval == hval && !memcmp(hPtr->key.string, key, tablePtr->keyType)) {
if (newPtr)
*newPtr = 0;
return hPtr;
}
/* Entry not found. Add a new one to the bucket. */
if (newPtr)
*newPtr = 1;
assert(tablePtr->keyType >= JSI_KEYS_STRUCT_MINSIZE);
size = sizeof(Jsi_HashEntry) + tablePtr->keyType;
if ((uint)tablePtr->keyType > sizeof(jsi_HashKey)) // Avoid memory checker problems by not truncating struct.
size -= sizeof(jsi_HashKey);
hPtr = (Jsi_HashEntry*)Jsi_Calloc(1, size);
Jsi_HashEntry **bucketPtr = tablePtr->buckets + hindex;
hPtr->typ = JSI_MAP_HASH;
hPtr->tablePtr = tablePtr;
hPtr->nextPtr = *bucketPtr;
hPtr->hval = hval;
hPtr->clientData = 0;
memcpy(hPtr->key.string, key, tablePtr->keyType);
*bucketPtr = hPtr;
tablePtr->numEntries++;
/*
* If the table has exceeded a decent size, rebuild it with many
* more buckets.
*/
if (tablePtr->numEntries >= tablePtr->rebuildSize)
RebuildTable(tablePtr);
return hPtr;
} | 218,707,585,208,628,380,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,488 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_TraceFuncCall(Jsi_Interp *interp, Jsi_Func *fstatic, jsi_OpCode *iPtr,
Jsi_Value *_this, Jsi_Value* args, Jsi_Value *ret, int tc)
{
jsi_OpCode *ip = (iPtr ? iPtr : interp->curIp);
if (!ip)
return;
const char *ff, *fname = ip->fname?ip->fname:"";
if ((tc&jsi_callTraceFullPath)==0 && ((ff=Jsi_Strrchr(fname,'/'))))
fname = ff+1;
if (interp->traceHook)
(*interp->traceHook)(interp, fstatic->name, ip->fname, ip->Line, fstatic->cmdSpec, _this, args, ret);
else {
const char *fp = ((tc&jsi_callTraceNoParent)?NULL:fstatic->parentName);
if (fp && !*fp)
fp = NULL;
Jsi_DString aStr;
Jsi_DSInit(&aStr);
Jsi_DString dStr;
Jsi_DSInit(&dStr);
Jsi_DString pStr;
Jsi_DSInit(&pStr);
Jsi_DString *sPtr = NULL;
int plen = 0;
if (ret) {
sPtr = &dStr;
Jsi_DSAppend(sPtr, " <-- ", NULL);
plen = Jsi_DSLength(sPtr);
Jsi_ValueGetDString(interp, ret, sPtr, 0);
} else if ((tc&jsi_callTraceArgs)) {
sPtr = &aStr;
Jsi_ValueGetDString(interp, args, sPtr, JSI_OUTPUT_JSON);
}
if (sPtr) {
if (!(tc&jsi_callTraceNoTrunc)) {
const char *cp0 = Jsi_DSValue(sPtr), *cp1 = Jsi_Strchr(cp0, '\n');
int nlen = 0, clen = Jsi_DSLength(sPtr);
if (cp1) {
nlen = (cp1-cp0);
if (nlen>60) nlen = 60;
} else if (clen>60)
nlen = 60;
else nlen = clen;
if (nlen != clen && clen>plen) {
Jsi_DSSetLength(sPtr, nlen);
Jsi_DSAppend(sPtr, "...", NULL);
}
}
}
if (interp->parent && interp->debugOpts.traceCallback) {
Jsi_DString jStr={}, kStr={}, lStr={};
Jsi_DSPrintf(&kStr, "[\"%s%s%s\", %s, %s, \"%s\", %d, %d ]",
(fp?fp:""), (fp?".":""), fstatic->name,
(ret?"null":Jsi_JSONQuote(interp, Jsi_DSValue(&aStr),-1, &jStr)),
(ret?Jsi_JSONQuote(interp, Jsi_DSValue(&dStr),-1, &lStr):"null"),
fname, ip->Line, ip->Lofs);
if (Jsi_FunctionInvokeJSON(interp->parent, interp->debugOpts.traceCallback, Jsi_DSValue(&kStr), NULL) != JSI_OK)
Jsi_DSPrintf(&pStr, "failed trace call\n");
Jsi_DSFree(&jStr);
Jsi_DSFree(&kStr);
Jsi_DSFree(&lStr);
} else if ((tc&jsi_callTraceBefore))
Jsi_DSPrintf(&pStr, "%s:%d %*s#%d: %c %s%s%s(%s) %s\n",
fname, ip->Line,
(interp->level-1)*2, "", interp->level,
(ret?'<':'>'), (fp?fp:""), (fp?".":""), fstatic->name, Jsi_DSValue(&aStr), Jsi_DSValue(&dStr));
else {
if (!interp->curIp || !interp->logOpts.before) {
Jsi_DSPrintf(&pStr, "%*s#%d: %c %s%s%s(%s) in %s:%d%s\n", (interp->level-1)*2, "", interp->level,
(ret?'<':'>'), (fp?fp:""), (fp?".":""), fstatic->name, Jsi_DSValue(&aStr),
fname, ip->Line, Jsi_DSValue(&dStr));
} else {
int quote = 0;
jsi_SysPutsCmdPrefix(interp, &interp->logOpts, &pStr, "e, NULL);
Jsi_DSPrintf(&pStr, "%*s#%d: %c %s%s%s(%s) \n", (interp->level-1)*2, "", interp->level,
(ret?'<':'>'), (fp?fp:""), (fp?".":""), fstatic->name, Jsi_DSValue(&aStr));
Jsi_DSAppend(&pStr, Jsi_DSValue(&dStr), NULL);
}
}
if (Jsi_DSLength(&pStr))
Jsi_Puts(interp, jsi_Stderr, Jsi_DSValue(&pStr), -1);
Jsi_DSFree(&pStr);
Jsi_DSFree(&dStr);
Jsi_DSFree(&aStr);
}
} | 274,790,024,627,937,770,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,489 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueIsUndef(Jsi_Interp *interp, Jsi_Value *pv)
{
return (pv->vt == JSI_VT_UNDEF);
} | 196,070,976,808,777,320,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,490 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | Jsi_MapEntry* Jsi_MapSet(Jsi_Map *mapPtr, const void *key, const void *value){
SIGASSERT(mapPtr, MAP);
Jsi_MapEntry* mptr = NULL;
switch (mapPtr->typ) {
case JSI_MAP_HASH: mptr = (Jsi_MapEntry*)Jsi_HashSet(mapPtr->v.hash, (void*)key, (void*)value); break;
case JSI_MAP_TREE: mptr = (Jsi_MapEntry*)Jsi_TreeSet(mapPtr->v.tree, (void*)key, (void*)value); break;
case JSI_MAP_LIST: {
mptr = Jsi_MapEntryNew(mapPtr, key, NULL);
Jsi_MapValueSet(mptr, (void*)value);
break;
}
case JSI_MAP_NONE: break;
}
return mptr;
} | 120,905,711,680,515,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,491 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueIsString(Jsi_Interp *interp, Jsi_Value *pv)
{
return (pv->vt == JSI_VT_STRING || (pv->vt == JSI_VT_OBJECT && pv->d.obj->ot == JSI_OT_STRING));
} | 116,548,733,277,019,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,492 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_FSNameToChannel(Jsi_Interp *interp, const char *name)
{
if (Jsi_Strlen(name)==1) {
switch (name[0]) {
case '0' : return jsiIntData.stdChans;
case '1' : return jsiIntData.stdChans+1;
case '2' : return jsiIntData.stdChans+2;
}
}
if (!Jsi_Strcmp(name, "stdin")) return jsiIntData.stdChans;
if (!Jsi_Strcmp(name, "stdout")) return jsiIntData.stdChans+1;
if (!Jsi_Strcmp(name, "stderr")) return jsiIntData.stdChans+2;
Jsi_Obj *obj = jsi_UserObjFromName(interp, name);
if (!obj)
return NULL;
Jsi_UserObj *uobj = obj->d.uobj;
if (uobj->reg != &fileobject)
return NULL;
FileObj *fobj = (FileObj *)uobj->data;
return fobj->chan;
} | 305,334,029,828,528,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,493 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_FSPathInFilesystemProc(Jsi_Interp *interp, Jsi_Value* path,void **clientDataPtr) {return 1;} | 88,527,408,195,828,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,494 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 *jsonNewStringObj(Jsi_Interp *interp, const char* str, int len)
{
Jsi_Value *v = NULL;
Jsi_DString dStr;
Jsi_DSInit(&dStr);
jsonNewDString(interp, &dStr, str, len);
v = Jsi_ValueNew(interp);
Jsi_ValueFromDS(interp, &dStr, &v);
//Jsi_DSFree(&dStr);
return v;
} | 1,960,149,254,126,613,500,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,495 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static int tree_inorder(Jsi_Tree *treePtr, Jsi_TreeEntry *hPtr, Jsi_TreeWalkProc *callback, void *data) {
uint epoch = treePtr->epoch;
if (hPtr == NULL) return JSI_OK;
if (hPtr->right != NULL) {
if (tree_inorder(treePtr, hPtr->right, callback, data) != JSI_OK || epoch != treePtr->epoch)
return JSI_ERROR;
}
if (callback(treePtr, hPtr, data) != JSI_OK || epoch != treePtr->epoch)
return JSI_ERROR;
Assert(hPtr->treePtr);
if (hPtr->left != NULL) {
if (tree_inorder(treePtr, hPtr->left, callback, data) != JSI_OK || epoch != treePtr->epoch)
return JSI_ERROR;
}
return JSI_OK;
} | 77,192,023,041,972,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,496 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_GetOption(Jsi_Interp *interp, Jsi_OptionSpec *specPtr, void* record, const char *option, Jsi_Value **valuePtr, Jsi_Wide flags)
{
char *ptr;
if (specPtr == NULL)
return Jsi_LogError("no such option: %s", option);
//isNull = ((*string == '\0') && (specPtr->flags & JSI_OPTION_NULL_OK));
ptr = (char *)record + specPtr->offset;
if (_JSICASTINT(specPtr->id)<0 || specPtr->id>=JSI_OPTION_END)
return Jsi_LogError("no such option: %s", option);
if (specPtr->custom) {
Jsi_OptionCustom* cust = Jsi_OptionCustomBuiltin(specPtr->custom);
if (cust->formatProc)
return (*cust->formatProc) (interp, specPtr, valuePtr, NULL, record, flags);
}
switch (specPtr->id) {
case JSI_OPTION_BOOL:
Jsi_ValueMakeBool(interp, valuePtr,*(bool*)ptr );
break;
case JSI_OPTION_INT:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(int *)ptr));
break;
case JSI_OPTION_UINT:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(uint *)ptr));
break;
case JSI_OPTION_INT8:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(int8_t *)ptr));
break;
case JSI_OPTION_INT16:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(int16_t *)ptr));
break;
case JSI_OPTION_INT32:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(int32_t *)ptr));
break;
case JSI_OPTION_INT64:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(Jsi_Wide *)ptr));
break;
case JSI_OPTION_UINT8:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(uint8_t *)ptr));
break;
case JSI_OPTION_UINT16:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(uint16_t *)ptr));
break;
case JSI_OPTION_UINT32:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(uint32_t *)ptr));
break;
case JSI_OPTION_UINT64:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)(*(uint64_t *)ptr));
break;
case JSI_OPTION_FLOAT:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)*(float *)ptr);
break;
case JSI_OPTION_DOUBLE:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)*(double *)ptr);
break;
case JSI_OPTION_LDOUBLE:
Jsi_ValueMakeNumber(interp, valuePtr, (Jsi_Number)*(ldouble *)ptr);
break;
case JSI_OPTION_NUMBER:
Jsi_ValueMakeNumber(interp, valuePtr, *(Jsi_Number *)ptr);
break;
case JSI_OPTION_SIZE_T:
Jsi_ValueMakeNumber(interp, valuePtr, *(size_t *)ptr);
break;
case JSI_OPTION_SSIZE_T:
Jsi_ValueMakeNumber(interp, valuePtr, *(ssize_t *)ptr);
break;
case JSI_OPTION_INTPTR_T:
Jsi_ValueMakeNumber(interp, valuePtr, *(intptr_t *)ptr);
break;
case JSI_OPTION_UINTPTR_T:
Jsi_ValueMakeNumber(interp, valuePtr, *(uintptr_t *)ptr);
break;
case JSI_OPTION_LONG:
Jsi_ValueMakeNumber(interp, valuePtr, *(long *)ptr);
break;
case JSI_OPTION_ULONG:
Jsi_ValueMakeNumber(interp, valuePtr, *(ulong *)ptr);
break;
case JSI_OPTION_SHORT:
Jsi_ValueMakeNumber(interp, valuePtr, *(short *)ptr);
break;
case JSI_OPTION_USHORT:
Jsi_ValueMakeNumber(interp, valuePtr, *(ushort *)ptr);
break;
case JSI_OPTION_DSTRING:
Jsi_ValueFromDS(interp, (Jsi_DString*)ptr, valuePtr);
break;
case JSI_OPTION_TIME_W: {
Jsi_DString dStr = {};
Jsi_DatetimeFormat(interp, (Jsi_Number)(*(Jsi_Wide*)ptr), "", 0, &dStr);
Jsi_ValueFromDS(interp, &dStr, valuePtr);
break;
}
case JSI_OPTION_TIME_D: {
Jsi_DString dStr = {};
Jsi_DatetimeFormat(interp, (Jsi_Number)(*(double*)ptr), "", 0, &dStr);
Jsi_ValueFromDS(interp, &dStr, valuePtr);
break;
}
case JSI_OPTION_TIME_T: {
Jsi_DString dStr = {};
Jsi_DatetimeFormat(interp, 1000LL* (Jsi_Number)*(time_t*)ptr, "%Y-%m-%d %H:%M:%S", 0, &dStr);
Jsi_ValueFromDS(interp, &dStr, valuePtr);
break;
}
case JSI_OPTION_STRBUF:
if (ptr)
Jsi_ValueMakeStringDup(interp, valuePtr, ptr);
else
Jsi_ValueMakeNull(interp, valuePtr);
break;
case JSI_OPTION_STRKEY:
ptr = *(char **)ptr;
if (ptr)
Jsi_ValueMakeStringDup(interp, valuePtr, ptr);
else
Jsi_ValueMakeNull(interp, valuePtr);
break;
case JSI_OPTION_STRING:
case JSI_OPTION_VAR:
case JSI_OPTION_FUNC:
case JSI_OPTION_USEROBJ:
case JSI_OPTION_OBJ:
case JSI_OPTION_VALUE:
case JSI_OPTION_REGEXP:
case JSI_OPTION_ARRAY:
if (*(Jsi_Value **)ptr)
Jsi_ValueCopy(interp, *valuePtr, *(Jsi_Value **)ptr);
else
Jsi_ValueMakeNull(interp, valuePtr);
break;
case JSI_OPTION_CUSTOM:
break;
#ifdef __cplusplus
case JSI_OPTION_END:
#else
default:
#endif
Jsi_LogBug("invalid option id %d", specPtr->id);
return JSI_ERROR;
}
return JSI_OK;
} | 97,504,150,127,509,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,497 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_GetNumberFromValue(Jsi_Interp* interp, Jsi_Value *value, Jsi_Number *n)
{
if (!value)
return JSI_ERROR;
if (value->vt == JSI_VT_NUMBER) {
*n = value->d.num;
return JSI_OK;
}
if (value->vt == JSI_VT_OBJECT && value->d.obj->ot == JSI_OT_NUMBER) {
*n = value->d.obj->d.num;
return JSI_OK;
}
if (interp)
Jsi_LogError("invalid number");
return JSI_ERROR;
} | 151,787,862,327,781,800,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,498 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 ValueFree(Jsi_Interp *interp, Jsi_Value* v)
{
SIGASSERTV(v,VALUE);
//printf("FREE: %d\n", interp->valueCnt);
switch (v->vt) {
case JSI_VT_OBJECT:
Jsi_ObjDecrRefCount(interp, v->d.obj);
break;
case JSI_VT_VARIABLE:
assert(v->d.lval != v);
Jsi_DecrRefCount(interp, v->d.lval);
break;
case JSI_VT_STRING:
if (v->d.s.str && !v->f.bits.isstrkey) {
Jsi_Free(v->d.s.str);
/*Jsi_HashEntry *hPtr;
if ((hPtr = Jsi_HashEntryFind(strDebug, v->d.s.str)))
Jsi_HashEntryDelete(hPtr);*/
}
break;
default:
break;
}
v->vt = JSI_VT_UNDEF;
} | 326,710,429,116,101,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,499 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 WebSocketHeaderCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
return WebSocketIdCmdOp(interp, args, _this, ret, funcPtr, 1);
} | 315,028,370,206,961,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,500 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_InitOptions(Jsi_Interp *interp, int release) {
if (release) return JSI_OK;
assert((sizeof(jsi_OptTypeInfo)/sizeof(jsi_OptTypeInfo[0])) == (JSI_OPTION_END+1));
int i;
for (i=JSI_OPTION_BOOL; i<JSI_OPTION_END; i++)
assert(jsi_OptTypeInfo[i].id == (Jsi_OptionId)i);
return JSI_OK;
} | 181,366,544,722,780,230,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,501 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 WebSocketQueryCmd(Jsi_Interp *interp, Jsi_Value *args, Jsi_Value *_this,
Jsi_Value **ret, Jsi_Func *funcPtr)
{
return WebSocketIdCmdOp(interp, args, _this, ret, funcPtr, 2);
} | 287,145,468,713,544,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,502 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 mdbTypeNameHashInit(MySqlObj *jdb) {
Jsi_Interp *interp = jdb->interp;
Jsi_Hash *hPtr = jdb->typeNameHash = Jsi_HashNew(interp, JSI_KEYS_STRING, NULL);
Jsi_HashSet(hPtr, (void*)"string", (void*)MYSQL_TYPE_STRING);
Jsi_HashSet(hPtr, (void*)"double", (void*)MYSQL_TYPE_DOUBLE);
Jsi_HashSet(hPtr, (void*)"integer", (void*)MYSQL_TYPE_LONGLONG);
Jsi_HashSet(hPtr, (void*)"bool", (void*)MYSQL_TYPE_TINY);
Jsi_HashSet(hPtr, (void*)"blob", (void*)MYSQL_TYPE_BLOB);
Jsi_HashSet(hPtr, (void*)"date", (void*)MYSQL_TYPE_DATE);
Jsi_HashSet(hPtr, (void*)"time", (void*)MYSQL_TYPE_TIME);
Jsi_HashSet(hPtr, (void*)"timestamp", (void*)MYSQL_TYPE_TIMESTAMP);
Jsi_HashSet(hPtr, (void*)"datetime", (void*)MYSQL_TYPE_DATETIME);
} | 174,209,107,174,391,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,503 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_wsAddHeader(Jsi_Interp *interp, jsi_wsCmdObj *cmdPtr, struct lws *wsi, Jsi_Value *hdrs,
Jsi_DString *hStr) {
uchar buffer[JSI_BUFSIZ];
uchar *p = (unsigned char *)buffer, *end = p + sizeof(buffer);
int n = 0;
int i, hvl, argc = Jsi_ValueGetLength(interp, hdrs);
for (i=0; i<argc; i+=2) {
const char *hn = Jsi_ValueArrayIndexToStr(interp, hdrs, i, NULL),
*hv = Jsi_ValueArrayIndexToStr(interp, hdrs, i+1, &hvl);
if (hn && hv) {
if (lws_add_http_header_by_name(wsi, (const uchar *)hn, (const uchar *)hv, hvl, &p, end))
return false;
n = p - buffer;
if (n>0)
Jsi_DSAppendLen(hStr, (char*)buffer, n);
p = buffer;
}
}
return true;
} | 127,901,561,986,523,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,504 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueStrlen(Jsi_Value* v) {
//if (v->vt == JSI_VT_OBJECT && v->d.obj->ot == JSI_OT_STRING && v->d.obj->isBlob)
// return v->d.obj->d.s.len;
Jsi_String *s = jsi_ValueString(v);
if (s == 0 || s->str == 0)
return 0;
#if JSI__UTF8
return (int)Jsi_NumUtfChars(s->str, s->len);
#else
if (s->len>=0) return s->len;
return (int)Jsi_NumUtfChars(s->str, s->len);
#endif
} | 103,159,613,242,795,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,505 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_IsShared(Jsi_Interp* interp, Jsi_Value *v)
{
SIGASSERT(v,VALUE);
return (v->refCnt > 1);
} | 326,105,690,726,614,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,506 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueObjLookup(Jsi_Interp *interp, Jsi_Value *target, const char *key, int isstrkey)
{
Jsi_Obj *obj;
Jsi_Value *v = NULL;
if (interp->subOpts.noproto && key) {
if (key[0] == 'p' && Jsi_Strcmp(key, "prototype")==0) {
Jsi_LogError("inheritance is disabled in interp");
return NULL;
}
}
if (target->vt != JSI_VT_OBJECT) {
if (interp->strict)
Jsi_LogWarn("Target is not object: %d", target->vt);
return NULL;
}
obj = target->d.obj;
#if (defined(JSI_HAS___PROTO__) && JSI_HAS___PROTO__==2)
if (*key == '_' && Jsi_Strcmp(key, "__proto__")==0 && interp->noproto==0)
return obj->__proto__;
#endif
if (*key == 't' && Jsi_Strcmp(key, "this")==0)
return interp->framePtr->inthis;
if (obj->arr)
v = jsi_ObjArrayLookup(interp, obj, key);
if (!v)
v= Jsi_TreeObjGetValue(obj, key, isstrkey);
return v; /* TODO: redo with copy */
} | 169,694,764,605,756,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,507 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_ValueIsFunction(Jsi_Interp *interp, Jsi_Value *v)
{
int rc = (v!=NULL && v->vt == JSI_VT_OBJECT && v->d.obj->ot == JSI_OT_FUNCTION);
if (!rc) return rc;
if (interp == v->d.obj->d.fobj->interp)
return 1;
fprintf(stderr, "OOPS: function in wrong interp %s: %s\n",
interp->parent?"(string came in from parent interp?)":"",
v->d.obj->d.fobj->func->name);
return 0;
} | 170,443,897,802,413,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,508 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_this(jsi_Pstate *p, jsi_Pline *line) { JSI_NEW_CODESLN(0,OP_PUSHTHS, 0); } | 153,136,189,018,061,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,509 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_MapKeyGet(Jsi_MapEntry *h, int flags){
switch (jsi_GetListType(h)) {
case JSI_MAP_HASH: return Jsi_HashKeyGet((Jsi_HashEntry*)h);
case JSI_MAP_TREE: return Jsi_TreeKeyGet((Jsi_TreeEntry*)h);
case JSI_MAP_LIST: break;
case JSI_MAP_NONE: break;
}
return NULL;
} | 22,206,804,474,406,517,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,510 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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* dbEvalSetColumnValue(DbEvalContext *p, int iCol, Jsi_Value **val) {
Jsi_Interp *interp = p->jdb->interp;
sqlite3_stmt *pStmt = p->pPreStmt->pStmt;
const char *str;
switch( sqlite3_column_type(pStmt, iCol) ) {
case SQLITE_BLOB: {
int bytes = sqlite3_column_bytes(pStmt, iCol);
const char *zBlob = (char*)sqlite3_column_blob(pStmt, iCol);
if( !zBlob )
return Jsi_ValueMakeNull(interp, val);
unsigned char *uptr = (unsigned char*)Jsi_Malloc(bytes+1);
memcpy(uptr, zBlob, bytes);
uptr[bytes] = 0;
return Jsi_ValueMakeBlob(interp, val, uptr, bytes);
break;
}
case SQLITE_INTEGER: {
sqlite_int64 v = sqlite3_column_int64(pStmt, iCol);
if (v==0 ||v==1) {
const char *dectyp = sqlite3_column_decltype(pStmt, iCol);
if (dectyp && !Jsi_Strncasecmp(dectyp,"bool", 4)) {
return Jsi_ValueMakeBool(interp, val, v);
}
}
if( v>=-2147483647 && v<=2147483647 ) {
return Jsi_ValueMakeNumber(interp, val, v);
} else {
return Jsi_ValueMakeNumber(interp, val, v);
}
break;
}
case SQLITE_FLOAT: {
return Jsi_ValueMakeNumber(interp, val, (Jsi_Number)sqlite3_column_double(pStmt, iCol));
break;
}
case SQLITE_NULL: {
return Jsi_ValueMakeNull(interp, val);
break;;
}
case SQLITE_TEXT: {
if (!p->jdb->noJsonConv) {
const char *dectyp = sqlite3_column_decltype(pStmt, iCol);
if (dectyp && !Jsi_Strncasecmp(dectyp, "charjson", 8)) {
Jsi_Value *v = Jsi_ValueNew(interp);// NULL; //Jsi_ValueNew1(interp);
str = (char*)sqlite3_column_text(pStmt, iCol );
if (JSI_OK != Jsi_JSONParse(interp, str, &v, 0))
Jsi_LogWarn("JSON parse failure for CHARJSON column");
return v;
}
}
}
default:
str = (char*)sqlite3_column_text(pStmt, iCol );
if (!str)
str = p->jdb->optPtr->nullvalue;
return Jsi_ValueMakeStringDup(interp, val, str?str:"");
}
return Jsi_ValueNew1(interp);
} | 292,450,288,669,446,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,511 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 char *jsiRlCmdMatches(const char *text, int state) {
static int idx, len;
const char *name;
Jsi_Interp* interp = jsi_interactiveInterp;
if (completeValues == NULL || !Jsi_ValueIsArray(interp, completeValues))
return NULL;
Jsi_Value **arr = completeValues->d.obj->arr;
int aLen = completeValues->d.obj->arrCnt;
if (!state)
{
idx = 0;
len = Jsi_Strlen(text)-jsiRlStart;
}
while (idx<aLen)
{
name = Jsi_ValueString(interp, arr[idx], NULL);
if (!name) name = "";
idx++;
if (Jsi_Strncmp(name, text+jsiRlStart, len) == 0)
return (Jsi_Strdup(name));
}
return NULL;
} | 248,789,432,517,683,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,512 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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 *codes_join3(Jsi_OpCodes *a, Jsi_OpCodes *b, Jsi_OpCodes *c)
{
return codes_join(codes_join(a, b), c);
} | 171,237,394,792,707,940,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,513 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.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_push_try(Jsi_Interp* interp, jsi_TryList **head, jsi_TryList *n)
{
interp->tryList = n;
interp->framePtr->tryDepth++;
n->next = *head;
*head = n;
} | 159,489,375,907,098,210,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |
520,514 | jsish | 430ea27accd4d4ffddc946c9402e7c9064835a18 | https://github.com/pcmacdon/jsish | https://github.com/pcmacdon/jsish/commit/430ea27accd4d4ffddc946c9402e7c9064835a18 | Release "3.0.7": Fix toPrecision bug "stack overflow #4".
FossilOrigin-Name: 6c7f0c37027d7f890b57cb38f776af39b8f81f03e60ceeb0a231a1d21e24b5de | 0 | static const char *JsiCharsetMatch(const char *pattern, int c, int flags)
{
int inot = 0;
int pchar;
int match = 0;
int nocase = 0;
if (flags & JSI_CMP_NOCASE) {
nocase++;
c = toupper(c);
}
if (flags & JSI_CMP_CHARSET_SCAN) {
if (*pattern == '^') {
inot++;
pattern++;
}
/* Special case. If the first char is ']', it is part of the set */
if (*pattern == ']') {
goto first;
}
}
while (*pattern && *pattern != ']') {
/* Exact match */
if (pattern[0] == '\\') {
first:
pattern += Jsi_UtfToUniCharCase(pattern, &pchar, nocase);
}
else {
/* Is this a range? a-z */
int start;
int end;
pattern += Jsi_UtfToUniCharCase(pattern, &start, nocase);
if (pattern[0] == '-' && pattern[1]) {
/* skip '-' */
pattern += Jsi_UtfToUniChar(pattern, &pchar);
pattern += Jsi_UtfToUniCharCase(pattern, &end, nocase);
/* Handle reversed range too */
if ((c >= start && c <= end) || (c >= end && c <= start)) {
match = 1;
}
continue;
}
pchar = start;
}
if (pchar == c) {
match = 1;
}
}
if (inot) {
match = !match;
}
return match ? pattern : NULL;
} | 201,042,771,579,347,540,000,000,000,000,000,000,000 | None | null | [
"CWE-120"
] | CVE-2020-22873 | Buffer overflow vulnerability in function NumberToPrecisionCmd in jsish before 3.0.7, allows remote attackers to execute arbitrary code. | https://nvd.nist.gov/vuln/detail/CVE-2020-22873 |