author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Tue, 2 May 2006 01:31:02 +0000 (03:31 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 2 May 2006 05:14:03 +0000 (22:14 -0700) | ||
commit | 0111ea38cbb9db0e4e245dcd5c86198186bab197 | |
tree | 1b07e4777ce4d4db3b63d21cba3607ddd5d02993 | tree | snapshot |
parent | 7bc70a590db6ed3069d52aa38d59938e7955901b | commit | diff |
cache-tree: replace a sscanf() by two strtol() calls
On one of my systems, sscanf() first calls strlen() on the buffer. But
this buffer is not terminated by NUL. So git crashed.
strtol() does not share that problem, as it stops reading after the
first non-digit.
[jc: original patch was wrong and did not read the cache-tree
structure correctly; this has been fixed up and tested minimally
with fsck-objects. ]
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
On one of my systems, sscanf() first calls strlen() on the buffer. But
this buffer is not terminated by NUL. So git crashed.
strtol() does not share that problem, as it stops reading after the
first non-digit.
[jc: original patch was wrong and did not read the cache-tree
structure correctly; this has been fixed up and tested minimally
with fsck-objects. ]
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache-tree.c | diff | blob | history |