Description: <short summary of the patch>
 TODO: Put a short summary on the line above and replace this paragraph
 with a longer explanation of this change. Complete the meta-information
 with other relevant fields (see below for details). To make it easier, the
 information below has been extracted from the changelog. Adjust it or drop
 it.
 .
 mtbl (1.1.1-2) experimental; urgency=medium
 .
   * Cherry-pick "reader: do not assume size_t is 64-bit when decoding
     varints" and "mtbl_verify: Use %zu for size_t instead of PRIu64" commits
     from upstream branch "fix-32bit-size_t".
Author: Robert Edmonds <edmonds@debian.org>

---
The information above should follow the Patch Tagging Guidelines, please
checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
are templates for supplementary fields that you might want to add:

Origin: <vendor|upstream|other>, <url of original patch>
Bug: <url in upstream bugtracker>
Bug-Debian: https://bugs.debian.org/<bugnumber>
Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
Forwarded: <no|not-needed|url proving that it has been forwarded>
Reviewed-By: <name and email of someone who approved the patch>
Last-Update: 2017-10-28

--- mtbl-1.1.1.orig/mtbl/reader.c
+++ mtbl-1.1.1/mtbl/reader.c
@@ -187,7 +187,9 @@ mtbl_reader_init_fd(int fd, const struct
 		index_len_len = sizeof(uint32_t);
 		index_len = mtbl_fixed_decode32(r->data + r->m.index_block_offset + 0);
 	} else {
-		index_len_len = mtbl_varint_decode64(r->data + r->m.index_block_offset + 0, &index_len);
+		uint64_t tmp;
+		index_len_len = mtbl_varint_decode64(r->data + r->m.index_block_offset + 0, &tmp);
+		index_len = tmp;
 	}
 	index_crc = mtbl_fixed_decode32(r->data + r->m.index_block_offset + index_len_len);
 	index_data = r->data + r->m.index_block_offset + index_len_len + sizeof(uint32_t);
@@ -250,7 +252,9 @@ get_block(struct mtbl_reader *r, uint64_
 		raw_contents_size_len = sizeof(uint32_t);
 		raw_contents_size = mtbl_fixed_decode32(&r->data[offset + 0]);
 	} else {
-		raw_contents_size_len = mtbl_varint_decode64(&r->data[offset + 0], &raw_contents_size);
+		uint64_t tmp;
+		raw_contents_size_len = mtbl_varint_decode64(&r->data[offset + 0], &tmp);
+		raw_contents_size = tmp;
 	}
 	raw_contents = &r->data[offset + raw_contents_size_len + sizeof(uint32_t)];
 
--- mtbl-1.1.1.orig/src/mtbl_verify.c
+++ mtbl-1.1.1/src/mtbl_verify.c
@@ -85,7 +85,9 @@ verify_data_blocks(
 			raw_contents_size = mtbl_fixed_decode32(&data[offset + 0]);
 			raw_contents_size_len = sizeof(uint32_t);
 		} else {
-			raw_contents_size_len = mtbl_varint_decode64(&data[offset + 0], &raw_contents_size);
+			uint64_t tmp;
+			raw_contents_size_len = mtbl_varint_decode64(&data[offset + 0], &tmp);
+			raw_contents_size = tmp;
 		}
 
 		/* Bounds check. */
@@ -93,7 +95,7 @@ verify_data_blocks(
 		bytes_consumed += raw_contents_size;
 		if (bytes_consumed > bytes_data_blocks) {
 			clear_line_stdout();
-			fprintf(stderr, "%s: Error: Block length (%'" PRIu64 " bytes) exceeds "
+			fprintf(stderr, "%s: Error: Block length (%'zu bytes) exceeds "
 				"total data length at "
 				"data block %" PRIu64 " (%" PRIu64 " bytes into file)\n",
 				prefix,
