From: Eric Sunshine Date: Wed, 07 Feb 2024 17:26:15 GMT Subject: Re: [PATCH v2 4/5] Always check `parse_tree*()`'s return value Message-ID: In-Reply-To: On Wed, Feb 7, 2024 at 11:48 AM Johannes Schindelin via GitGitGadget wrote: > Always check `parse_tree*()`'s return value If you happen to reroll for some reason, perhaps: s/Always/always/ > Otherwise we may easily run into serious crashes: For example, if we run > `init_tree_desc()` directly after a failed `parse_tree()`, we are > accessing uninitialized data or trying to dereference `NULL`. > > Note that the `parse_tree()` function already takes care of showing an > error message. The `parse_tree_indirectly()` and > `repo_get_commit_tree()` functions do not, therefore those latter call > sites need to show a useful error message while the former do not. > > Signed-off-by: Johannes Schindelin