author | Jeff King <peff@peff.net> | |
Thu, 16 Feb 2012 08:03:52 +0000 (03:03 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 17 Feb 2012 15:52:41 +0000 (07:52 -0800) | ||
commit | 839de2527258879aa21ae7ad425353f06dbb4717 | |
tree | 96c99542c123e40dd65fac8d9f2dbbb64b29e733 | tree | snapshot |
parent | 27370b1170fbd5859e9d88e91be9108e04b6725e | commit | diff |
config: copy the return value of prefix_filename
The prefix_filename function returns a pointer to a static
buffer which may be overwritten by subsequent calls. Since
we are going to keep the result around for a while, let's be
sure to duplicate it for safety.
I don't think this can be triggered as a bug in the current
code, but it's a good idea to be defensive, as any resulting
bug would be quite subtle.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The prefix_filename function returns a pointer to a static
buffer which may be overwritten by subsequent calls. Since
we are going to keep the result around for a while, let's be
sure to duplicate it for safety.
I don't think this can be triggered as a bug in the current
code, but it's a good idea to be defensive, as any resulting
bug would be quite subtle.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/config.c | diff | blob | history |