On 2020-05-23 20:33, Hans Ulrich Niedermann wrote:
The comment is valid for MB1, but not for MB2. Both regarding the alignment and regarding the size. And regarding the size, this actually means there is a bug in the code here: An MB2 header is at least 16 bytes for the header magic plus at least 8 bytes for the mb2 header termination tag. That adds up to 24 bytes for MB2, not 12 bytes as it did for MB1.
I see, so there is at least that. Might be a good idea to fix it.
I fear you have missed that bytes and grub_uint32_t array elements are not the same size.
I unfortunately did not notice the (grub_uint32_t *), I apologize for assuming that it increments by 2 bytes and not u32's. Wouldn't it be a lot cleaner if it just incremented it in bytes instead, since you could then also remove the division by 4 and the cast? It wouldn't make any difference runtime wise, just a bit easier to read.
Jacob _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel