I just noticed the line above. I thought that this was a problem late last night and remembered to mark it today. I believe you're right, though, that there won't be an ArrayIndexOutOfBoundsException. It would be good to include that in the unit test (which I'll look at later).
On 23 April 2014 10:01, Ralph Goers <[email protected]> wrote: > Given that the index is checked for localParentsLength -1 under what > circumstances will the buffer overflow? > > Ralph > > On Apr 23, 2014, at 7:47 AM, [email protected] wrote: > > > Author: mattsicker > > Date: Wed Apr 23 14:47:10 2014 > > New Revision: 1589432 > > > > URL: http://svn.apache.org/r1589432 > > Log: > > Note a potential bug. > > > > Modified: > > > > logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/MarkerManager.java > > > > Modified: > logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/MarkerManager.java > > URL: > http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/MarkerManager.java?rev=1589432&r1=1589431&r2=1589432&view=diff > > > ============================================================================== > > --- > logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/MarkerManager.java > (original) > > +++ > logging/log4j/log4j2/trunk/log4j-api/src/main/java/org/apache/logging/log4j/MarkerManager.java > Wed Apr 23 14:47:10 2014 > > @@ -155,6 +155,7 @@ public final class MarkerManager { > > if (index == localParentsLength - 1) { > > return false; > > } > > + // FIXME: buffer overflow > > markers[index++] = marker; > > } > > } > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > -- Matt Sicker <[email protected]>
