[syslinux:lwip] dmi: fix more pointer subtraction bugs

syslinux-bot for H. Peter Anvin hpa at linux.intel.com
Tue Apr 26 17:42:02 PDT 2011


Commit-ID:  b65011e22077f51ef32db3b7d9791bfe0f7684a4
Gitweb:     http://syslinux.zytor.com/commit/b65011e22077f51ef32db3b7d9791bfe0f7684a4
Author:     H. Peter Anvin <hpa at linux.intel.com>
AuthorDate: Tue, 26 Apr 2011 17:36:37 -0700
Committer:  H. Peter Anvin <hpa at linux.intel.com>
CommitDate: Tue, 26 Apr 2011 17:36:37 -0700

dmi: fix more pointer subtraction bugs

Two more places with bogus pointer subtraction...

Signed-off-by: H. Peter Anvin <hpa at linux.intel.com>


---
 core/dmi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/dmi.c b/core/dmi.c
index 988a4e8..e4deb15 100644
--- a/core/dmi.c
+++ b/core/dmi.c
@@ -283,13 +283,13 @@ static const char *dmi_install_string(const char *pfx, const char *str)
     }
 
     pfxlen = strlen(pfx);
-    q = nstr = malloc(pfxlen + (ep-p) + 1);
+    q = nstr = malloc(pfxlen + (ep-str) + 1);
     if (!nstr)
 	return NULL;
     memcpy(q, pfx, pfxlen);
     q += pfxlen;
     memcpy(q, str, ep-str);
-    q += (ep-p);
+    q += (ep-str);
     *q = '\0';
 
     return nstr;



More information about the Syslinux-commits mailing list