lib/pb-protocol: fix deserialise of boot option priorities
[petitboot] / lib / pb-protocol / pb-protocol.c
index 3c472febdb14c88a7a0ef82112230c2d67d2fbc3..cf27b8ec49c35ff47bfdfff00cc43f36e9f06015 100644 (file)
@@ -890,6 +890,9 @@ int pb_protocol_deserialise_config(struct config *config,
                        config->n_boot_priorities);
 
        for (i = 0; i < config->n_boot_priorities; i++) {
+               if (read_u32(&pos, &len, &tmp))
+                       goto out;
+               config->boot_priorities[i].priority = (int)tmp;
                if (read_u32(&pos, &len, &tmp))
                        goto out;
                config->boot_priorities[i].type = tmp;