From 532d3c6a63760c49f3374d97217b33a47ddd8873 Mon Sep 17 00:00:00 2001 From: condret Date: Thu, 23 Oct 2014 13:16:32 +0200 Subject: [PATCH] make r_io_mwrite check map->flags --- libr/io/vio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libr/io/vio.c b/libr/io/vio.c index cc5aa9d13e..4b65059fd5 100644 --- a/libr/io/vio.c +++ b/libr/io/vio.c @@ -267,6 +267,8 @@ R_API int r_io_mwrite (RIO *io, int fd, ut64 maddr, ut8 *buf, int len) { write_bytes -= d; maddr += d; } + if (!(map->flags & R_IO_WRITE)) //check if the map allows writing + return write_bytes; paddr = maddr - map->from + map->delta; desc = io->desc; io->desc = r_io_desc_get (io, fd);