mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-22 03:03:18 +00:00
Addressed CodeQL analysis
This commit is contained in:
@@ -1389,7 +1389,7 @@ duk_ret_t ILibDuktape_GenericMarshal_MethodInvokeAsync_thread_id(duk_context *ct
|
||||
if (!ILibMemory_CanaryOK(data)) { return(ILibDuktape_Error(ctx, "FFI Object was already freed")); }
|
||||
|
||||
char tmp[255];
|
||||
sprintf_s(tmp, sizeof(tmp), "%ul", data->workerThreadId);
|
||||
sprintf_s(tmp, sizeof(tmp), "%llu", (uint64_t)data->workerThreadId);
|
||||
duk_push_string(ctx, tmp);
|
||||
return(1);
|
||||
|
||||
@@ -1561,7 +1561,7 @@ void ILibDuktape_GlobalGenericCallback_ProcessEx(void *chain, void *user)
|
||||
if (!ILibMemory_CanaryOK(data->emitter)) { return; }
|
||||
|
||||
char tmp[255];
|
||||
sprintf_s(tmp, sizeof(tmp), "%ul", data->callingThread);
|
||||
sprintf_s(tmp, sizeof(tmp), "%llu", (uint64_t)data->callingThread);
|
||||
duk_push_heapptr(data->emitter->ctx, data->emitter->object); // [obj]
|
||||
duk_push_string(data->emitter->ctx, tmp); // [obj][str]
|
||||
duk_put_prop_string(data->emitter->ctx, -2, ILibDuktape_GenericMarshal_GlobalCallback_ThreadID); // [obj]
|
||||
@@ -2121,7 +2121,7 @@ duk_ret_t ILibDuktape_GenericMarshal_GetCurrentThread(duk_context *ctx)
|
||||
#if defined(WIN32)
|
||||
sprintf_s(tmp, sizeof(tmp), "%ul", GetCurrentThreadId());
|
||||
#else
|
||||
sprintf_s(tmp, sizeof(tmp), "%ul", pthread_self());
|
||||
sprintf_s(tmp, sizeof(tmp), "%llu", pthread_self());
|
||||
#endif
|
||||
duk_push_string(ctx, tmp);
|
||||
return(1);
|
||||
|
||||
@@ -4390,7 +4390,7 @@ duk_ret_t ILibDuktape_http_generateNonce(duk_context *ctx)
|
||||
}
|
||||
else
|
||||
{
|
||||
return(ILibDuktape_Error(ctx, "Specified length is too long. Please Specify a value < %d", sizeof(ILibScratchPad)));
|
||||
return(ILibDuktape_Error(ctx, "Specified length is too long. Please Specify a value < %llu", (uint64_t)sizeof(ILibScratchPad)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -303,7 +303,7 @@ void ILibDuktape_VERIFIER_EndSink(ILibDuktape_WritableStream *stream, void *user
|
||||
// Error
|
||||
duk_get_prop_string(data->ctx, -1, "_rej"); // [promise][rejector]
|
||||
duk_swap_top(data->ctx, -2); // [rejector][this]
|
||||
duk_push_sprintf(data->ctx, "EVP_VerifyFinal(): Returned error (%d) ", ERR_get_error()); // [rejector][this][error]
|
||||
duk_push_sprintf(data->ctx, "EVP_VerifyFinal(): Returned error (%llu) ", (uint64_t)ERR_get_error()); // [rejector][this][error]
|
||||
duk_call_method(data->ctx, 1); // [...]
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -414,7 +414,7 @@ duk_ret_t ILibDuktape_fs_readSync(duk_context *ctx)
|
||||
int bytesRead;
|
||||
FILE *f = ILibDuktape_fs_getFilePtr(ctx, duk_require_int(ctx, 0));
|
||||
|
||||
if (length > (int)bufferSize) { return(ILibDuktape_Error(ctx, "fs.readSync(): Buffer of size: %d bytes, but attempting to read %d bytes", bufferSize, length)); }
|
||||
if (length > (int)bufferSize) { return(ILibDuktape_Error(ctx, "fs.readSync(): Buffer of size: %llu bytes, but attempting to read %d bytes", (uint64_t)bufferSize, length)); }
|
||||
|
||||
if (f != NULL)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user