soup_date_new_from_string: fix an out-of-bounds memory access
authorDan Winship <danw@gnome.org>
Thu, 10 Jun 2010 00:06:51 +0000 (20:06 -0400)
committerDan Winship <danw@gnome.org>
Thu, 10 Jun 2010 00:10:59 +0000 (20:10 -0400)
commitea57345a5c5f00fe85801b3f528687b93793afff
treeff071f9abde002e07a983be7186293386ff6f290
parentceceaa912cd02660eecacd52d9a1ffc4d15c3c00
soup_date_new_from_string: fix an out-of-bounds memory access

soup_date_new_from_string() would sometimes read off the end of the
string, but tests/date didn't catch this even under valgrind, because
all of the strings were compile-time constants and they got laid out
in a way that never triggered a read of invalid memory. So tweak the
test to g_strdup each string before parsing it, which will let
valgrind notice if we read outside its bounds in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=620288
libsoup/soup-date.c
tests/date.c