]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: (gpt) don't access entries array directly
authorKarel Zak <kzak@redhat.com>
Wed, 5 Apr 2017 12:19:13 +0000 (14:19 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 5 Apr 2017 12:19:13 +0000 (14:19 +0200)
commitb28df75eece3b65b79b2e56f1c197c2f128ac3d9
tree24cb7247f30d3391792d2eebe86e19a7b8bce563
parent4739b6fd3e162ca5fd860bb2be111eb92623fc99
libfdisk: (gpt) don't access entries array directly

We blindly assume that our sizeof(struct gpt_entry) is the same
on-disk stored header->sizeof_partition_entry.

It seems more correct would be to use sizeof specified by header to
access the entries array items. This patch introduces gpt_get_entry()
to avoid direct access to gpt->ents[].

Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/gpt.c