/* 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
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>
}
}
- 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;