From 3db7bf5dfd2f4c21789acf0f9c7de714d9544309 Mon Sep 17 00:00:00 2001 From: Christoffer Lerno Date: Fri, 6 Sep 2024 18:05:43 +0200 Subject: [PATCH] Crash when reading an empty 'manifest.json'. --- releasenotes.md | 1 + src/build/libraries.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/releasenotes.md b/releasenotes.md index 7fc411ddd..5fe7836e3 100644 --- a/releasenotes.md +++ b/releasenotes.md @@ -11,6 +11,7 @@ - Deprecated inline generic types. - Deprecated tuple / triple types. - Converting a slice to a vector/array would copy too little data. +- Crash when reading an empty 'manifest.json'. ### Stdlib changes *None yet* diff --git a/src/build/libraries.c b/src/build/libraries.c index 26a6af912..aca739d98 100644 --- a/src/build/libraries.c +++ b/src/build/libraries.c @@ -172,6 +172,10 @@ INLINE JSONObject* read_manifest(const char *lib, const char *manifest_data) { error_exit("Error on line %d reading '%s':'%s'", parser.line, lib, parser.error_message); } + if (!json) + { + error_exit("Empty 'manifest.json' for library '%s'.", lib); + } return json; }