Skip to content

Commit

Permalink
win32: boot broken when bind & data dir are the same
Browse files Browse the repository at this point in the history
With upstream commit#ea1edcd7da1a "vl: relocate paths to data
directories", the data dir logic was unified between POSIX &
Win32. That patch moved to using 'get_relocated_path()', to
find the data dir. There is a latent bug in get_relocated_path
which can cause it to spin indefinitely, when the bind dir is
the same as the passed in dir (in this case, it was the data
dir).

Signed-off-by: Sunil Muthuswamy <sunilmut@microsoft.com>
Message-Id: <SN4PR2101MB08802BF242C429A15DDB32ACC01B0@SN4PR2101MB0880.namprd21.prod.outlook.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
sunilmut authored and bonzini committed Oct 26, 2020
1 parent 57e2a1f commit 7a3b7f6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/cutils.c
Expand Up @@ -949,7 +949,7 @@ char *get_relocated_path(const char *dir)
bindir += len_bindir;
dir = next_component(dir, &len_dir);
bindir = next_component(bindir, &len_bindir);
} while (len_dir == len_bindir && !memcmp(dir, bindir, len_dir));
} while (len_dir && len_dir == len_bindir && !memcmp(dir, bindir, len_dir));

/* Ascend from bindir to the common prefix with dir. */
while (len_bindir) {
Expand Down

0 comments on commit 7a3b7f6

Please sign in to comment.