Zero initialize storage for status viewing

FossilOrigin-Name: 09259a3fdce6bd1e9eef7bd29d12c8540580ebc82b9d86e8225cb1dbcf814c14
This commit is contained in:
me@ow.nekobit.net 2022-04-28 12:25:47 +00:00
parent 223237f7b1
commit 67ca10565d
2 changed files with 6 additions and 4 deletions

View file

@ -42,7 +42,7 @@ char* construct_error(char* error, enum error_type type, unsigned pad, size_t* s
size_t s = easprintf(&error_html, data_error_html,
class,
pad ? "error-pad" : "",
error);
error ? error : "An error occured");
if (size) *size = s;
return error_html;
}

View file

@ -531,9 +531,11 @@ void content_status(struct session* ssn, mastodont_t* api, char** data, int is_r
{
char* output;
// Status context
struct mstdnt_storage storage, status_storage;
struct mstdnt_status* statuses_before, *statuses_after, status = { 0 };
size_t stat_before_len, stat_after_len;
struct mstdnt_storage storage = {0}, status_storage = {0};
struct mstdnt_status* statuses_before = NULL,
*statuses_after = NULL,
status = { 0 };
size_t stat_before_len = 0, stat_after_len = 0;
char* before_html = NULL, *stat_html = NULL, *after_html = NULL, *stat_reply = NULL;
try_post_status(ssn, api);