git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/3] sha1_file.c: mark strings for translation

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Feb 27, 2016, 07:49 UTC
Message-ID
<1456559373-13589-1-git-send-email-pclouds@gmail.com>
In-Reply-To
<20160225142004.GA17678@sigill.intra.peff.net>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 Since jk/pack-idx-corruption-safety is already in 'next', can we add
 this patch on top? Surrounding strings are handled separately [1] by
 another series.
 [1] http://thread.gmane.org/gmane.comp.version-control.git/287661/focus=287678
 sha1_file.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sha1_file.c b/sha1_file.c
index 4a3a032..b8da68b 100644
--- a/sha1_file.c
+++ b/sha1_file.c
@@ -1042,7 +1042,7 @@ unsigned char *use_pack(struct packed_git *p,
 	if (offset > (p->pack_size - 20))
 		die("offset beyond end of packfile (truncated pack?)");
 	if (offset < 0)
-		die("offset before end of packfile (broken .idx?)");
+		die(_("offset before end of packfile (broken .idx?)"));
 
 	if (!win || !in_window(win, offset)) {
 		if (win)
@@ -2367,11 +2367,11 @@ void check_pack_index_ptr(const struct packed_git *p, const void *vptr)
 	const unsigned char *start = p->index_data;
 	const unsigned char *end = start + p->index_size;
 	if (ptr < start)
-		die("offset before start of pack index for %s (corrupt index?)",
+		die(_("offset before start of pack index for %s (corrupt index?)"),
 		    p->pack_name);
 	/* No need to check for underflow; .idx files must be at least 8 bytes */
 	if (ptr >= end - 8)
-		die("offset beyond end of pack index for %s (truncated index?)",
+		die(_("offset beyond end of pack index for %s (truncated index?)"),
 		    p->pack_name);
 }
 
-- 
2.8.0.rc0.205.g7ec8cf1
Previous: Jeff KingNext: Junio C Hamano
Message 8 of 10 in “out-of-bounds access from corrupted .idx files”
  1. 0/3 out-of-bounds access from corrupted .idx filesJeff King, Feb 25, 2016
  2. 1/3 t5313: test bounds-checks of corrupted/malicious pack/idx filesJeff King, Feb 25, 2016
  3. Johannes SixtFeb 25, 2016
  4. Junio C HamanoFeb 25, 2016
  5. Jeff KingFeb 25, 2016
  6. 2/3 nth_packed_object_offset: bounds-check extended offsetJeff King, Feb 25, 2016
  7. 3/3 use_pack: handle signed off_t overflowJeff King, Feb 25, 2016
  8. 4/3 sha1_file.c: mark strings for translationNguyễn Thái Ngọc Duy, Feb 27, 2016
  9. Junio C HamanoFeb 27, 2016
  10. Jeff KingFeb 27, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.