Files
git/builtin
John Keeping d954828d45 builtin/mv: don't use memory after free
If 'src' already ends with a slash, then add_slash() will just return
it, meaning that 'free(src_with_slash)' is actually 'free(src)'.  Since
we use 'src' later, this will result in use-after-free.

In fact, this cannot happen because 'src' comes from
internal_copy_pathspec() without the KEEP_TRAILING_SLASH flag, so any
trailing '/' will have been stripped; but static analysis tools are not
clever enough to realise this and so warn that 'src' could be used after
having been free'd.  Fix this by checking that 'src_w_slash' is indeed
newly allocated memory.

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-02-18 15:51:56 -08:00
..
2014-01-10 10:33:03 -08:00
2013-12-17 12:02:44 -08:00
2014-01-10 10:33:11 -08:00
2014-01-17 12:21:20 -08:00
2013-12-17 12:02:44 -08:00
2014-01-17 12:21:20 -08:00
2014-01-17 12:21:20 -08:00
2013-12-30 12:27:01 -08:00
2014-01-17 12:21:20 -08:00
2013-10-23 13:21:31 -07:00
2013-09-09 14:36:15 -07:00
2014-01-27 10:44:59 -08:00
2014-02-18 15:51:56 -08:00
2014-01-17 12:21:20 -08:00
2013-12-27 14:57:50 -08:00
2014-01-17 12:21:20 -08:00
2013-12-17 12:02:44 -08:00
2013-07-15 10:56:07 -07:00
2014-01-17 12:21:20 -08:00
2013-09-09 14:36:15 -07:00