]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
drd: Fix an integer overflow in the stack margin calculation
authorBart Van Assche <bvanassche@acm.org>
Fri, 22 Mar 2019 03:08:45 +0000 (20:08 -0700)
committerBart Van Assche <bvanassche@acm.org>
Fri, 22 Mar 2019 03:09:16 +0000 (20:09 -0700)
NEWS
drd/drd_main.c

diff --git a/NEWS b/NEWS
index c9431a2a3923099f6b9763d09bb6be628638e538..a460d8eae5df59ce1c163e4da905ff27d919992b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -112,6 +112,7 @@ where XXXXXX is the bug number as listed below.
 405079  unhandled ppc64le-linux syscall: 131 (quotactl)
 405403  s390x disassembler cannot be used on x86
 405458  MIPS mkFormVEC arguments swapped?
+405716  drd: Fix an integer overflow in the stack margin calculation
 
 n-i-bz  add syswrap for PTRACE_GET|SET_THREAD_AREA on amd64.
 n-i-bz  Fix callgrind_annotate non deterministic order for equal total
index 3df967ef2875abcb411fae56085589c08429f2d2..6d6ca637dc23c0c0d29fa8b18a481ba73b6e87e4 100644 (file)
@@ -705,12 +705,11 @@ static void drd_thread_finished(ThreadId vg_tid)
          = (DRD_(thread_get_stack_max)(drd_tid)
             - DRD_(thread_get_stack_min_min)(drd_tid));
       VG_(message)(Vg_UserMsg,
-                   "thread %u%s finished and used %lu bytes out of %lu"
-                   " on its stack. Margin: %lu bytes.\n",
+                   "thread %u%s finished and used %lu bytes out of %lu on its stack. Margin: %ld bytes.\n",
                    drd_tid,
                    DRD_(thread_get_joinable)(drd_tid)
                    ? "" : " (which is a detached thread)",
-                   used_stack, stack_size, stack_size - used_stack);
+                   used_stack, stack_size, (long)(stack_size - used_stack));
 
    }
    drd_stop_using_mem(DRD_(thread_get_stack_min)(drd_tid),