MCPcopy Create free account
hub / github.com/RsyncProject/rsync / read_varint_bounded

Function read_varint_bounded

io.c:1904–1913  ·  view source on GitHub ↗

As read_int_bounded but for varint-encoded values. */

Source from the content-addressed store, hash-verified

1902
1903/* As read_int_bounded but for varint-encoded values. */
1904int32 read_varint_bounded(int f, int32 lo, int32 hi, const char *what)
1905{
1906 int32 v = read_varint(f);
1907 if (v < lo || v > hi) {
1908 rprintf(FERROR, "wire value %s out of range: %ld not in [%ld,%ld] [%s]\n",
1909 what, (long)v, (long)lo, (long)hi, who_am_i());
1910 exit_cleanup(RERR_PROTOCOL);
1911 }
1912 return v;
1913}
1914
1915/* Read a varint that will be used as a size_t. Rejects negative values
1916 * (which would wrap to ~SIZE_MAX) and values exceeding the supplied max. */

Callers 4

recv_ida_entriesFunction · 0.85
recv_file_entryFunction · 0.85
read_del_statsFunction · 0.85
receive_xattrFunction · 0.85

Calls 3

read_varintFunction · 0.85
rprintfFunction · 0.70
who_am_iFunction · 0.70

Tested by

no test coverage detected