Skip to content

Commit

Permalink
chunk-format: drop pair_chunk_unsafe()
Browse files Browse the repository at this point in the history
There are no callers left, and we don't want anybody to add new ones (they
should use the not-unsafe version instead). So let's drop the function.

Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
peff authored and gitster committed Oct 9, 2023
1 parent 12192a9 commit ca06f0f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
8 changes: 0 additions & 8 deletions chunk-format.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,14 +184,6 @@ int pair_chunk(struct chunkfile *cf,
return read_chunk(cf, chunk_id, pair_chunk_fn, &pcd);
}

int pair_chunk_unsafe(struct chunkfile *cf,
uint32_t chunk_id,
const unsigned char **p)
{
size_t dummy;
return pair_chunk(cf, chunk_id, p, &dummy);
}

int read_chunk(struct chunkfile *cf,
uint32_t chunk_id,
chunk_read_fn fn,
Expand Down
13 changes: 0 additions & 13 deletions chunk-format.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,6 @@ int pair_chunk(struct chunkfile *cf,
const unsigned char **p,
size_t *size);

/*
* Unsafe version of pair_chunk; it does not return the size,
* meaning that the caller cannot possibly be careful about
* reading out of bounds from the mapped memory.
*
* No new callers should use this function, and old callers should
* be audited and migrated over to using the regular pair_chunk()
* function.
*/
int pair_chunk_unsafe(struct chunkfile *cf,
uint32_t chunk_id,
const unsigned char **p);

typedef int (*chunk_read_fn)(const unsigned char *chunk_start,
size_t chunk_size, void *data);
/*
Expand Down

0 comments on commit ca06f0f

Please sign in to comment.