stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Farid Zaripov" <Farid_Zari...@epam.com>
Subject RE: svn commit: r555006 - /incubator/stdcxx/trunk/src/catalog.cpp
Date Thu, 12 Jul 2007 17:20:07 GMT
> -----Original Message-----
> From: Martin Sebor [mailto:sebor@roguewave.com] 
> Sent: Wednesday, July 11, 2007 10:14 PM
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: svn commit: r555006 - 
> /incubator/stdcxx/trunk/src/catalog.cpp
> 
> > 	* catalog.cpp (catopen): while() loop replaced to for() loop
> > 	with checking for max iterations.
> 
> Does this fix a bug?

  Definitely :)

  As you can see the __rw_catlist container resized only if i ==
__rw_catlist.size(),
but before of that __rw_catlist.size()'th element is accessed in while
(__rw_catlist[i] != 0)
and this is undefined behavior.

> If it does, is the bug easily 
> reproducible so we can add a test case for it to the bug 
> tracking database?

  For the test case the valid catalog should be created (.dll file on
windows).
It's not so easy and platform dependent. Of course we can use
generate_catalog ()
function from 22.locale.messages.cpp test.

Farid.

Mime
View raw message