[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Compare bug in liblber/memory.c (ITS#3116)

Thanks.  A fix has been applied to HEAD. -- Kurt

At 01:40 PM 4/26/2004, bill_woody@symantec.com wrote:
>Full_Name: William Edward Woody
>Version: 2.2.8
>OS: Win XP
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (
>At line 347 of libraries\liblber\memory.c, the debug version of the memory
>management code does the following compare:
>if ((s - oldlen) > 0) { ...
>The problem is that on Microsoft Visual C++, one of the two terms (I forgot
>which off the top of my head) is an unsigned quantity, and the compare is
>promoted to an unsigned value. 
>Thus, the compare will almost always return true. This causes a number of
>headaches when memory debugging is turned on while compiling for Visual C++
>By rewriting the compare as:
>if (s > oldlen) {
>this appears to fix the problem.