Skip to content

Commit

Permalink
wt-status-deserialize: fix crash when -v is used
Browse files Browse the repository at this point in the history
Fix crash in `git status -v` by setting `des_s->repo`
to a non-null value.

Upstream changes to eliminate use of `the_repository`
added a `repo` field to `struct status`.  And calls in
`wt-status.c` to `repo_init_revisions()` were changed
to pass `s->repo` rather than `the_repository`.

The status deserialization code was not updated to
actually set `s->repo` before common code passed the
value to OID routines.

This caused a segfault when verbose output was requested.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
  • Loading branch information
jeffhostetler authored and dscho committed Aug 8, 2023
1 parent 729dca6 commit 710c2ba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wt-status-deserialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ static int wt_deserialize_fd(const struct wt_status *cmd_s, struct wt_status *de
/*
* Copy over display-related fields from the current command.
*/
des_s->repo = cmd_s->repo;
des_s->verbose = cmd_s->verbose;
/* amend */
/* whence */
Expand Down

0 comments on commit 710c2ba

Please sign in to comment.