diff --git a/src/libostree/ostree-core.c b/src/libostree/ostree-core.c index c70ca708..887108f6 100644 --- a/src/libostree/ostree-core.c +++ b/src/libostree/ostree-core.c @@ -990,7 +990,7 @@ subst_xxxxxx (GRand *rand, while (*xxxxxx == 'X') { - int offset = g_random_int_range (0, sizeof (table)); + int offset = g_random_int_range (0, sizeof (table) - 1); *xxxxxx = (guint8)table[offset]; xxxxxx++; }