Browse Source

Merge branch 'bp/fsmonitor-bufsize-fix'

Fix an unexploitable (because the oversized contents are not under
attacker's control) buffer overflow.

* bp/fsmonitor-bufsize-fix:
  fsmonitor: fix incorrect buffer size when printing version number
maint
Junio C Hamano 7 years ago
parent
commit
beed7e22fd
  1. 2
      fsmonitor.c

2
fsmonitor.c

@ -104,7 +104,7 @@ static int query_fsmonitor(int version, uint64_t last_update, struct strbuf *que @@ -104,7 +104,7 @@ static int query_fsmonitor(int version, uint64_t last_update, struct strbuf *que
if (!(argv[0] = core_fsmonitor))
return -1;

snprintf(ver, sizeof(version), "%d", version);
snprintf(ver, sizeof(ver), "%d", version);
snprintf(date, sizeof(date), "%" PRIuMAX, (uintmax_t)last_update);
argv[1] = ver;
argv[2] = date;

Loading…
Cancel
Save