1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-21 18:03:41 +03:00

ukify: fix padding length

This commit is contained in:
Yu Watanabe 2023-02-16 01:59:08 +09:00 committed by Luca Boccassi
parent 9ecf865433
commit c126c8ac81

View File

@ -441,7 +441,8 @@ def join_initrds(initrds):
seq = []
for file in initrds:
initrd = file.read_bytes()
padding = b'\0' * round_up(len(initrd), 4) # pad to 32 bit alignment
n = len(initrd)
padding = b'\0' * (round_up(n, 4) - n) # pad to 32 bit alignment
seq += [initrd, padding]
return b''.join(seq)