aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/plugins/sql
diff options
context:
space:
mode:
authorThomas Egerer <thomas.egerer@secunet.com>2014-02-27 09:45:08 +0100
committerTobias Brunner <tobias@strongswan.org>2014-03-03 17:27:58 +0100
commit7acdebf6c072b30cd91873d95143e184cf4663f0 (patch)
treed97db6b0d19c2198f7a5be80013fd7a45e337455 /src/libcharon/plugins/sql
parentaf15c71bfbfab2e732159f06bb024aa77a489246 (diff)
downloadstrongswan-7acdebf6c072b30cd91873d95143e184cf4663f0.tar.bz2
strongswan-7acdebf6c072b30cd91873d95143e184cf4663f0.tar.xz
settings: Avoid conf file parsing beyond allocated buffer
A valgrind analysis of libstrongswan revealed an invalid read of 1 in the function starts_with(). A more thorough analysis proved this to be true and showed that with a specially crafted config file (e.g. a single '#'-character not followed by a newline), the parser might even interpret the random memory contents following the allocated buffer as part of the configuration file. The way the parser is designed, it must be able to skip an inserted '\0' and continue parsing. Since it is not able to skip two '\0' characters, the 'fix' of allocating two more bytes than the size of the parsed file and setting them to '\0' seems to be a safe bet. Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
Diffstat (limited to 'src/libcharon/plugins/sql')
0 files changed, 0 insertions, 0 deletions