]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nptl_db/fetch-value.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / nptl_db / fetch-value.c
index afc26fc1efe23c0f4f0b10f23554834da1fbbd76..ce620c58ae521d77d8448d1f9dfe80d53b991a52 100644 (file)
@@ -1,5 +1,5 @@
 /* Helper routines for libthread_db.
-   Copyright (C) 2003-2015 Free Software Foundation, Inc.
+   Copyright (C) 2003-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -14,7 +14,7 @@
 
    You should have received a copy of the GNU Lesser General Public
    License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
+   <https://www.gnu.org/licenses/>.  */
 
 #include "thread_dbP.h"
 #include <byteswap.h>
@@ -69,7 +69,8 @@ _td_locate_field (td_thragent_t *ta,
        }
     }
 
-  if (idx != 0 && idx - (psaddr_t) 0 > DB_DESC_NELEM (desc))
+  if (idx != 0 && DB_DESC_NELEM (desc) != 0
+      && idx - (psaddr_t) 0 > DB_DESC_NELEM (desc))
     /* This is an internal indicator to callers with nonzero IDX
        that the IDX value is too big.  */
     return TD_NOAPLIC;