[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Invalid memory reads in first_non_fsm_start_char_cstring (utf_validate.c)

From: Hanno Böck <hanno_at_hboeck.de>
Date: Sat, 19 Dec 2015 00:03:59 +0100

Hi,

I recently tested to compile subversion with address sanitizer and it
would immediately show a global out of bounds read when showing the
help screen (svn help).

I actually was surprised that this seems to be semi-intentional. The
code in utf_validate.c has a comment stating that this reads
uninitialized bytes and there is an #ifdef option to disable it.

I think this is bad programming behavior and shouldn't be done in
production code. Reading invalid memory is undefined behavior in C,
therefore you cannot rely on that your software will function properly
when using such code.

cu,

-- 
Hanno Böck
http://hboeck.de/
mail/jabber: hanno_at_hboeck.de
GPG: BBB51E42

Received on 2015-12-19 00:03:58 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.