From a4af739f6783b7a4c917f8e897e9f97c77271487 Mon Sep 17 00:00:00 2001
From: Arman Arethna <aarethna@syudent.unimelb.edu.au>
Date: Wed, 21 Oct 2020 14:48:29 +0530
Subject: [PATCH] vuln-3 change
---
 poc/vuln-3.poc  | 4 +---
 src/vuln-3/dc.c | 6 +++---
 2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/poc/vuln-3.poc b/poc/vuln-3.poc
index ab75426..a24864b 100644
--- a/poc/vuln-3.poc
+++ b/poc/vuln-3.poc
@@ -1,4 +1,2 @@
 push 10
-store value
-load value
-store value
\ No newline at end of file
+*
\ No newline at end of file
diff --git a/src/vuln-3/dc.c b/src/vuln-3/dc.c
index 6f4facd..4231e12 100644
--- a/src/vuln-3/dc.c
+++ b/src/vuln-3/dc.c
@@ -84,8 +84,8 @@ static node_t *node_new(const char *varname, const value_t value){
    replaces p's value with that from q and frees q */
 static void node_edit_value(node_t * p, node_t *q){  
   p->value = q->value;
-  // free(q->varname);
-  // free(q);
+  free(q->varname);
+  free(q);
 }
 
 static void node_free(node_t *p){
@@ -503,7 +503,7 @@ static int execute(void){
       return -1;
     }
     
-    if (stack_size() < 2){
+    if (stack_size() < 1){
       debug_printf("Mult from insufficient stack\n");
       return -1;
     }
-- 
GitLab