[Pdbg] [PATCH 1/3] libpdbg: Add missing lazy probe in putmem

Rashmica Gupta rashmica.g at gmail.com
Tue May 15 13:42:07 AEST 2018


Without this patch, attempting to write to memory causes a segfault.

Signed-off-by: Rashmica Gupta <rashmica.g at gmail.com>
---
 src/mem.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mem.c b/src/mem.c
index 4f12dcf..815c1c7 100644
--- a/src/mem.c
+++ b/src/mem.c
@@ -60,6 +60,9 @@ static int putmem(uint64_t addr)
 	pdbg_for_each_class_target("adu", adu_target)
 		break;
 
+	if (pdbg_target_probe(adu_target) != PDBG_TARGET_ENABLED)
+		return 0;
+
 	buf = malloc(PUTMEM_BUF_SIZE);
 	assert(buf);
 	do {
-- 
2.14.3



More information about the Pdbg mailing list