summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorRené Scharfe <rene.scharfe@lsrfire.ath.cx>2010-03-13 17:37:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-03-13 21:18:09 (GMT)
commit8ca788035644f2aaf7a951272ae16a7bd319554c (patch)
tree0a9029d417f819d361294a1f2710a1a57ad99089 /daemon.c
parent34b383e7cd57692fd3996c1e8c9e738dab53ac48 (diff)
downloadgit-8ca788035644f2aaf7a951272ae16a7bd319554c.zip
git-8ca788035644f2aaf7a951272ae16a7bd319554c.tar.gz
git-8ca788035644f2aaf7a951272ae16a7bd319554c.tar.bz2
for_each_recent_reflog_ent(): use strbuf, fix offset handling
As Vladimir reported, "git log -g refs/stash" surprisingly showed the reflog of HEAD if the message in the reflog file was too long. To fix this, convert for_each_recent_reflog_ent() to use strbuf_getwholeline() instead of fgets(), for safety and to avoid any size limits for reflog entries. Also reverse the logic of the part of the function that only looks at file tails. It used to close the file if fgets() succeeded. The following fgets() call in the while loop was likely to fail in this case, too, so passing an offset to for_each_recent_reflog_ent() never worked. Change it to error out if strbuf_getwholeline() fails instead. Reported-by: Vladimir Panteleev <vladimir@thecybershadow.net> Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'daemon.c')
0 files changed, 0 insertions, 0 deletions