aboutsummaryrefslogtreecommitdiff
path: root/riscv/dts.h
diff options
context:
space:
mode:
authorRupert Swarbrick <rswarbrick@gmail.com>2022-02-22 02:58:18 +0000
committerGitHub <noreply@github.com>2022-02-21 18:58:18 -0800
commit5ba63a44706173b556b8d5632872b39a09d7f16d (patch)
tree4609ef25700b475092c6bd7e68aa9ee27f8ff040 /riscv/dts.h
parentaa72b99944faaa6439ed3e6744e5abbaa91562de (diff)
downloadriscv-isa-sim-5ba63a44706173b556b8d5632872b39a09d7f16d.zip
riscv-isa-sim-5ba63a44706173b556b8d5632872b39a09d7f16d.tar.gz
riscv-isa-sim-5ba63a44706173b556b8d5632872b39a09d7f16d.tar.bz2
Avoid an unnecessary strcpy (#925)
We don't actually know that the field in the DTB points at a string that's less than 256 bytes long, I don't think, so this could probably cause a buffer overflow on the stack. Anyway, it turns out that there's no need to copy anything anyway, so let's just update a char** instead.
Diffstat (limited to 'riscv/dts.h')
-rw-r--r--riscv/dts.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/riscv/dts.h b/riscv/dts.h
index 1c3a54d..6208151 100644
--- a/riscv/dts.h
+++ b/riscv/dts.h
@@ -23,5 +23,5 @@ int fdt_parse_clint(void *fdt, reg_t *clint_addr,
const char *compatible);
int fdt_parse_pmp_num(void *fdt, int cpu_offset, reg_t *pmp_num);
int fdt_parse_pmp_alignment(void *fdt, int cpu_offset, reg_t *pmp_align);
-int fdt_parse_mmu_type(void *fdt, int cpu_offset, char *mmu_type);
+int fdt_parse_mmu_type(void *fdt, int cpu_offset, const char **mmu_type);
#endif