about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--example/symbol_exec/dse_crackme.py13
-rw-r--r--miasm2/jitter/Jittcc.c10
-rw-r--r--test/core/asmblock.py2
3 files changed, 17 insertions, 8 deletions
diff --git a/example/symbol_exec/dse_crackme.py b/example/symbol_exec/dse_crackme.py
index e08536f9..34c39138 100644
--- a/example/symbol_exec/dse_crackme.py
+++ b/example/symbol_exec/dse_crackme.py
@@ -198,15 +198,15 @@ def xxx___libc_start_main_symb(dse):
     })
 
 # Stop the execution on puts and get back the corresponding string
-class FinnishOn(Exception):
+class FinishOn(Exception):
 
     def __init__(self, string):
         self.string = string
-        super(FinnishOn, self).__init__()
+        super(FinishOn, self).__init__()
 
 def xxx_puts_symb(dse):
     string = dse.jitter.get_str_ansi(dse.jitter.cpu.RDI)
-    raise FinnishOn(string)
+    raise FinishOn(string)
 
 
 done = set([]) # Set of jump address already handled
@@ -222,7 +222,6 @@ class DSEGenFile(DSEPathConstraint):
 
     def handle_solution(self, model, destination):
         global todo, done
-        assert destination.is_int()
 
         if destination in done:
             # Skip this path, already treated
@@ -288,9 +287,9 @@ while todo:
     # Play the current file
     try:
         sb.run()
-    except FinnishOn as finnish_info:
-        print finnish_info.string
-        if finnish_info.string == "OK":
+    except FinishOn as finish_info:
+        print finish_info.string
+        if finish_info.string == "OK":
             # Stop if the expected result is found
             found = True
             break
diff --git a/miasm2/jitter/Jittcc.c b/miasm2/jitter/Jittcc.c
index 1297336d..2a85375d 100644
--- a/miasm2/jitter/Jittcc.c
+++ b/miasm2/jitter/Jittcc.c
@@ -88,6 +88,11 @@ PyObject* tcc_set_emul_lib_path(PyObject* self, PyObject* args)
 			include_array_count ++;
 			include_array = realloc(include_array,
 						     include_array_count * sizeof(char*));
+			if (include_array == NULL)
+			{
+				fprintf(stderr, "cannot realloc char* include_array\n");
+				exit(EXIT_FAILURE);
+			}
 			include_array[include_array_count-1] = strdup(str1);
 			// fprintf(stderr, "adding include file: %s\n", str1);
 		}
@@ -102,6 +107,11 @@ PyObject* tcc_set_emul_lib_path(PyObject* self, PyObject* args)
 			lib_array_count ++;
 			lib_array = realloc(lib_array,
 						 lib_array_count * sizeof(char*));
+			if (lib_array == NULL)
+			{
+				fprintf(stderr, "cannot realloc char* lib_array\n");
+				exit(EXIT_FAILURE);
+			}
 			lib_array[lib_array_count-1] = strdup(str1);
 			// fprintf(stderr, "adding lib file: %s\n", str1);
 		}
diff --git a/test/core/asmblock.py b/test/core/asmblock.py
index 666c4665..c3b220df 100644
--- a/test/core/asmblock.py
+++ b/test/core/asmblock.py
@@ -74,7 +74,7 @@ assert len(first_block.bto) == 1
 assert list(first_block.bto)[0].c_t == AsmConstraint.c_next
 
 ## Simplify the obtained graph to keep only blocks which reach a block
-## finnishing with RET
+## finishing with RET
 
 def remove_useless_blocks(d_g, graph):
     """Remove leaves without a RET"""