public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: posix timers: fix uninitialized variable
Date: Wed, 26 Feb 2020 16:06:00 -0000	[thread overview]
Message-ID: <20200226160603.123551.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=28382c97a5d5fd7366adbf7ce9445b1b4beb02a9

commit 28382c97a5d5fd7366adbf7ce9445b1b4beb02a9
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Feb 26 16:50:34 2020 +0100

    Cygwin: posix timers: fix uninitialized variable
    
    The variable returning the overrun count from the tracker object after
    disarming the overrun counter was not correctly initialized.  For some
    reason this has only been noticed by gcc-9.2.0, not by the formerly used
    gcc-7.4.0.
    
    This problem should not have had any runtime impact.  The method
    timer_tracker::disarm_overrun_event is supposed to be called in
    lock-step with timer_tracker::arm_overrun_event, which in turn
    results in the variable getting a valid value.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/posix_timer.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/posix_timer.cc b/winsup/cygwin/posix_timer.cc
index c0d548f..75cd4fa 100644
--- a/winsup/cygwin/posix_timer.cc
+++ b/winsup/cygwin/posix_timer.cc
@@ -81,7 +81,7 @@ timer_tracker::arm_overrun_event (LONG64 exp_cnt)
 LONG
 timer_tracker::disarm_overrun_event ()
 {
-  LONG ret;
+  LONG ret = 0;
 
   AcquireSRWLockExclusive (&srwlock);
   if (overrun_count != OVR_DISARMED)


                 reply	other threads:[~2020-02-26 16:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200226160603.123551.qmail@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).