Git Product home page Git Product logo

Comments (4)

radare avatar radare commented on August 27, 2024

This is the commit I did to fix the segfault:

$ git format-patch HEAD^
0001-Fix-MIPS-disassembler-segfault.patch

$ xz < 0001-Fix-MIPS-disassembler-segfault.patch |base64
/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4AJLAaZdACMcieb23x44dHxFiPxaejNzD3JoPccbVwwO1tEqGGpv0ZXF0HhzcXz1AtvC3TUXZ2Fvl0JlIe7XbH1aAwdidz9eJ00/C5BAqOXVGi48GEQhprL9KGXDqnNjeqINlIWnwG3RW/imyMyrNCaM3ALiq0ZK19XRPP3Ubsrtr4mBbrB9GQL51cKSWhTxDAJoRwLCg5ZrDV+s8tPowXN5CWnK/Lbg4p9/2ggZwbehvNG+f8tqPu7EINs1GTzTkXWmcc5g41ndxCObVW6BCSgs8usdbWNpFAAJzXd+Ze2OzmxYiC6AVFNh82HSq+MxnL901aZ11/Y135ny7nvJYZtUIsVM13m/8U4+Tc3sJOujOa7BlDaMBs2wYOATspr13XgFYv6mIgXVIbTT+niT5Q7UdHG5ZG3Kb6CtStuDMJw2IEOSat+jBcQhVwwNnRWEMHRUNCwBAt4VU9MGCIVwQ5FCi3dAnl/DhRfsi/d1JdFaLou88ccHZPm9IkPTryt6s2s109mWcNva8FhoP+oY2UIg4tscrMwVcTX4N4/WetaJe9DaWdPvjXJg55GKAAAASTTAY6YLP3IAAcIDzAQAANDoR+OxxGf7AgAAAAAEWVo=

$ cat 0001-Fix-MIPS-disassembler-segfault.patch
From 53d23c94ce3062a265e2d11fb222550fd544f481 Mon Sep 17 00:00:00 2001
From: pancake <[email protected]>
Date: Fri, 6 Dec 2013 03:55:14 +0100
Subject: [PATCH] Fix MIPS disassembler segfault

---
 utils.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/utils.c b/utils.c
index 539ab14..3f9e968 100644
--- a/utils.c
+++ b/utils.c
@@ -27,6 +27,8 @@ int insn_find(insn_map *m, unsigned int max, unsigned int id)

    while(begin <= end) {
        i = (begin + end) / 2;
+       if (i>=max)
+           return -1;
        if (id == m[i].id)
            return i;
        else if (id < m[i].id)
--
1.8.3.4 (Apple Git-47)

from capstone.

aquynh avatar aquynh commented on August 27, 2024

Pancake, please could you provide the Mips code + arch + mode triggering
this crash, so i can verify if the root cause of the problem?

thanks,
Q

On Fri, Dec 6, 2013 at 10:57 AM, radare [email protected] wrote:

This is the commit I did to fix the segfault:

$ cat 0001-Fix-MIPS-disassembler-segfault.patch
From 53d23c94ce3062a265e2d11fb222550fd544f481 Mon Sep 17 00:00:00 2001
From: pancake [email protected]
Date: Fri, 6 Dec 2013 03:55:14 +0100
Subject: [PATCH] Fix MIPS disassembler segfault


utils.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/utils.c b/utils.c
index 539ab14..3f9e968 100644
--- a/utils.c
+++ b/utils.c
@@ -27,6 +27,8 @@ int insn_find(insn_map *m, unsigned int max, unsigned int id)

while(begin <= end) {
    i = (begin + end) / 2;
  •   if (i>=max)
    
  •       return -1;
    if (id == m[i].id)
        return i;
    else if (id < m[i].id)
    
    --
    1.8.3.4 (Apple Git-47)


Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-29959903
.

from capstone.

radare avatar radare commented on August 27, 2024

It's already in the description of the bug. See the rasm2 hexpairs

On 06 Dec 2013, at 04:59, Nguyen Anh Quynh [email protected] wrote:

Pancake, please could you provide the Mips code + arch + mode triggering
this crash, so i can verify if the root cause of the problem?

thanks,
Q

On Fri, Dec 6, 2013 at 10:57 AM, radare [email protected] wrote:

This is the commit I did to fix the segfault:

$ cat 0001-Fix-MIPS-disassembler-segfault.patch
From 53d23c94ce3062a265e2d11fb222550fd544f481 Mon Sep 17 00:00:00 2001
From: pancake [email protected]
Date: Fri, 6 Dec 2013 03:55:14 +0100
Subject: [PATCH] Fix MIPS disassembler segfault


utils.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/utils.c b/utils.c
index 539ab14..3f9e968 100644
--- a/utils.c
+++ b/utils.c
@@ -27,6 +27,8 @@ int insn_find(insn_map *m, unsigned int max, unsigned int id)

while(begin <= end) {
i = (begin + end) / 2;

  • if (i>=max)
  • return -1;
    if (id == m[i].id)
    return i;
    else if (id < m[i].id)

    1.8.3.4 (Apple Git-47)


Reply to this email directly or view it on GitHubhttps://github.com//issues/26#issuecomment-29959903
.


Reply to this email directly or view it on GitHub.

from capstone.

radare avatar radare commented on August 27, 2024

Please review/apply this patch before release

from capstone.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.