|
| From: | Hollis Blanchard |
| Subject: | Re: [Qemu-devel] [PATCH v1 2/2] generic-loader: Add a generic loader |
| Date: | Thu, 18 Feb 2016 10:23:12 -0800 |
| User-agent: | Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 |
On 02/17/2016 01:04 PM, Alistair Francis wrote:
+static void generic_loader_reset(DeviceState *dev)
+{
+ GenericLoaderState *s = GENERIC_LOADER(dev);
+
+ if (s->cpu) {
+ CPUClass *cc = CPU_GET_CLASS(s->cpu);
+ cpu_reset(s->cpu);
+ cc->set_pc(s->cpu, s->addr);
+ }
+
+ if (s->data_len) {
+ dma_memory_write((s->cpu ? s->cpu : first_cpu)->as, s->addr, &s->data,
+ s->data_len);
+ }
+}
What happens if I accidentally make "data-len" bigger than sizeof(s->data)? I think some bounds checking is needed?
Hollis Blanchard Mentor Graphics Emulation Division
| [Prev in Thread] | Current Thread | [Next in Thread] |