From fc16d51c7349b07a405085fd80548a6d0aaf31e8 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Wed, 30 Jun 2010 13:28:39 -0600 Subject: Bug 609590 - fix coverity Defect Type: Memory - corruptions issues https://bugzilla.redhat.com/show_bug.cgi?id=609590 Resolves: bug 609590 Bug Description: fix coverity Defect Type: Memory - corruptions issues Reviewed by: nhosoi (Thanks!) Branch: HEAD Fix Description: Do not allow pt->pt_sizendx to be == PLMAXSIZENDX Platforms tested: RHEL5 x86_64 Flag Day: no Doc impact: no --- lib/base/plist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/base/plist.cpp b/lib/base/plist.cpp index 3c3192d6..56873ce2 100644 --- a/lib/base/plist.cpp +++ b/lib/base/plist.cpp @@ -823,7 +823,8 @@ PListNameProp(PList_t plist, int pindex, const char *pname) /* Is it time to grow the hash table? */ i = PLSIZENDX(pt->pt_sizendx); - if (((size_t)pt->pt_sizendx < PLMAXSIZENDX) && + /* cannot allow pt->pt_sizendx == PLMAXSIZENDX */ + if (((size_t)(pt->pt_sizendx + 1) < PLMAXSIZENDX) && pt->pt_nsyms >= (i + i)) { PLSymbolTable_t *npt; -- cgit