summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2011-04-26 17:36:37 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2011-04-26 17:36:37 -0700
commitb65011e22077f51ef32db3b7d9791bfe0f7684a4 (patch)
treef25dc3c3c6658767d72a0258e5f06192d00c3ba7
parentae2dd06c076a447ec9ca8f7b02cdf15ef5e6ce15 (diff)
downloadsyslinux-b65011e22077f51ef32db3b7d9791bfe0f7684a4.tar.gz
dmi: fix more pointer subtraction bugs
Two more places with bogus pointer subtraction... Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
-rw-r--r--core/dmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/dmi.c b/core/dmi.c
index 988a4e8e..e4deb15b 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;