Trace more things. Add a CORS header for /mem so I can make an app to examine it. Fix a memory leak. Fix tf_realloc(NULL, 0).

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4187 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2023-02-18 23:43:00 +00:00
parent 88c7d91858
commit a9551b057b
4 changed files with 33 additions and 5 deletions

View File

@ -312,6 +312,7 @@ static JSValue _util_sha1_digest(JSContext* context, JSValueConst this_val, int
const char* value = JS_ToCStringLen(context, &length, argv[0]);
unsigned char digest[SHA_DIGEST_LENGTH] = { 0 };
SHA1((const unsigned char*)value, length, digest);
JS_FreeCString(context, value);
return JS_NewArrayBufferCopy(context, digest, sizeof(digest));
}