diff --git a/src/file.js.c b/src/file.js.c index 238c1e3e..a49a325f 100644 --- a/src/file.js.c +++ b/src/file.js.c @@ -234,6 +234,7 @@ static JSValue _file_read_file(JSContext* context, JSValueConst this_val, int ar }, .size = k_file_read_max, }; + memset(req + 1, 0, k_file_read_max); int result = uv_fs_open(tf_task_get_loop(task), &req->fs, file_name, UV_FS_O_RDONLY, 0, _file_read_open_callback); if (result < 0) { diff --git a/src/ssb.rpc.c b/src/ssb.rpc.c index a08e32fb..eea4b5c3 100644 --- a/src/ssb.rpc.c +++ b/src/ssb.rpc.c @@ -30,8 +30,7 @@ static int64_t _get_global_setting_int64(tf_ssb_t* ssb, const char* name, int64_ { if (sqlite3_bind_text(statement, 1, name, -1, NULL) == SQLITE_OK) { - if (sqlite3_step(statement) == SQLITE_ROW && - sqlite3_column_type(statement, 0) != SQLITE_NULL) + if (sqlite3_step(statement) == SQLITE_ROW && sqlite3_column_type(statement, 0) != SQLITE_NULL) { result = sqlite3_column_int64(statement, 0); } diff --git a/src/util.js.c b/src/util.js.c index 9d345c90..83d93906 100644 --- a/src/util.js.c +++ b/src/util.js.c @@ -46,10 +46,10 @@ static JSValue _util_utf8_decode(JSContext* context, JSValueConst this_val, int } else { - size_t offset; - size_t element_size; + size_t offset = 0; + size_t element_size = 0; JSValue buffer = tf_util_try_get_typed_array_buffer(context, argv[0], &offset, &length, &element_size); - size_t size; + size_t size = 0; if (!JS_IsException(buffer)) { array = tf_util_try_get_array_buffer(context, &size, buffer);