From c009a78bd228f848b7750293600438ef1b44e697 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sat, 2 Dec 2023 07:00:39 -0600 Subject: [PATCH] Prevent a malformed file from crashing actor fetching --- src/model/account.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/model/account.c b/src/model/account.c index 072624e..5298f7f 100644 --- a/src/model/account.c +++ b/src/model/account.c @@ -236,12 +236,17 @@ static struct account* account_load_from_id( int id, int recurse_limit ) return NULL; } + // Handle account migration if( a->replaced_by && a->replaced_by != a->id ) { int new_id = a->replaced_by; account_free(a); return account_load_from_id( new_id, recurse_limit - 1 ); } + // Sanity checks + if( !a->note ) { + a->note = strdup(""); + } if( !a->banner ) { a->banner = aformat( "https://%s/server/default-banner.blob", g_server->domain ); }