René Scharfe l@web.de writes:
Next call to the function invalidates the return value the last
caller received feels like playing with fire. Most existing
callers are safe in that the first thing they do to the returned
string is xstrdup() it, but we would need to check all the other
Use strbuf instead of fixed-sized buffers in real_path() in order to
avoid the size limitations of the latter.
Signed-off-by: Rene Scharfe l@web.de
---
abspath.c | 69 +++
1 file changed, 25 insertions(+), 44 deletions(-)
diff
On Mon, Jul 28, 2014 at 08:28:30PM +0200, René Scharfe wrote:
static const char *real_path_internal(const char *path, int die_on_error)
{
- static char bufs[2][PATH_MAX + 1], *buf = bufs[0], *next_buf = bufs[1];
+ static struct strbuf sb = STRBUF_INIT;
Hrm. I thought at first that
On Mon, Jul 28, 2014 at 08:28:30PM +0200, René Scharfe wrote:
@@ -60,26 +58,22 @@ static const char *real_path_internal(const char *path,
int die_on_error)
goto error_out;
}
- if (strlcpy(buf, path, PATH_MAX) = PATH_MAX) {
- if (die_on_error)
Jeff King p...@peff.net writes:
On Mon, Jul 28, 2014 at 08:28:30PM +0200, René Scharfe wrote:
@@ -60,26 +58,22 @@ static const char *real_path_internal(const char *path,
int die_on_error)
goto error_out;
}
-if (strlcpy(buf, path, PATH_MAX) = PATH_MAX) {
-
Am 28.07.2014 um 21:09 schrieb Jeff King:
On Mon, Jul 28, 2014 at 08:28:30PM +0200, René Scharfe wrote:
static const char *real_path_internal(const char *path, int die_on_error)
{
- static char bufs[2][PATH_MAX + 1], *buf = bufs[0], *next_buf = bufs[1];
+ static struct strbuf
Am 28.07.2014 um 23:42 schrieb Junio C Hamano:
Jeff King p...@peff.net writes:
On Mon, Jul 28, 2014 at 08:28:30PM +0200, René Scharfe wrote:
@@ -60,26 +58,22 @@ static const char *real_path_internal(const char *path, int
die_on_error)
goto error_out;
}
-
7 matches
Mail list logo