Skip to content

Commit

Permalink
Fix extended_printer_type migration
Browse files Browse the repository at this point in the history
The change looks innocent, right?
The problem is, 0 and 2 are of type int (4 B).
This resulted in crash in load_item,
because there is a check for data size.

BFW-5938
  • Loading branch information
CZDanol-prusa authored and danopernis committed Aug 21, 2024
1 parent d0e0e00 commit 948224d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ namespace migrations {

static_assert(extended_printer_type_model[0] == PrinterModel::mk4);
static_assert(extended_printer_type_model[2] == PrinterModel::mk3_9);
backend.save_migration_item(journal::hash("Extended Printer Type"), has_400_motors ? 0 : 2);
backend.save_migration_item<uint8_t>(journal::hash("Extended Printer Type"), has_400_motors ? 0 : 2);
}
#endif

Expand Down

0 comments on commit 948224d

Please sign in to comment.