summaryrefslogtreecommitdiff
path: root/util/hda-decoder
AgeCommit message (Collapse)Author
2024-08-29util/hda-decoder: Protect 'fields' slice if empty stringMaxim Polyakov
This avoids panic if the file contains an empty string or an incorrect configuration: goroutine 1 [running]: main.decodeFile({0x7ffd63da92a0?, 0xc000014070?}, 0x8?) /path/to/coreboot/util/hda-decoder/main.go:72 +0x2ef main.main() /path/to/coreboot/util/hda-decoder/main.go:158 +0x2a5 Change-Id: I9ae8544e52d82e8d8a82a88a85a2de7d2f295ec1 Signed-off-by: Maxim Polyakov <max.senia.poliak@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84101 Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
2024-07-15util: Add hda-decoderNicholas Sudsgaard
This tool helps take off the burden of manually decoding default configuration registers. Using decoded values can make code more self-documenting compared to shrouding it with magic numbers. This is also written as a module which allows easy integration with other tools written in Go (e.g. autoport). Change-Id: Ib4fb652e178517b2b7aceaac8be005c5b2d3b03e Signed-off-by: Nicholas Sudsgaard <devel+coreboot@nsudsgaard.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/80470 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Singer <service+coreboot-gerrit@felixsinger.de> Reviewed-by: Michael Niewöhner <foss@mniewoehner.de>