From 525590fa3638960f7a88ef0256a5e36c19f951a9 Mon Sep 17 00:00:00 2001 From: Matt Mascarenhas Date: Sun, 13 May 2018 17:10:05 +0100 Subject: [PATCH] cinera.c: Prevent crash when no ProjectInfo->Unit --- cinera/cinera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinera/cinera.c b/cinera/cinera.c index 57d3602..4ba2679 100644 --- a/cinera/cinera.c +++ b/cinera/cinera.c @@ -16,7 +16,7 @@ typedef struct version CINERA_APP_VERSION = { .Major = 0, .Minor = 5, - .Patch = 48 + .Patch = 49 }; // TODO(matt): Copy in the DB 3 stuff from cinera_working.c @@ -5503,7 +5503,7 @@ IndexToBuffer(index *Index, buffers *CollationBuffers) // NOTE(matt): This guy m } char Number[16]; index_metadata *This; - char Text[StringLength(ProjectUnit) + sizeof(Number) + sizeof(This->Title) + 3]; + char Text[ProjectUnit ? StringLength(ProjectUnit) : 0 + sizeof(Number) + sizeof(This->Title) + 3]; int EntryLength = StringLength(PlayerURL.Location) + sizeof(Text) + 82; CollationBuffers->Index.Size = StringLength(queryContainer) + (Index->Header.EntryCount * EntryLength) + StringLength(Script);