summarylogtreecommitdiffstats
path: root/fix-sizeof-use.patch
diff options
context:
space:
mode:
authorCharles Bos2015-06-09 12:45:08 +0100
committerCharles Bos2015-06-09 12:45:08 +0100
commitb883208c9753f7febef3803cc2e61261c14ed9c2 (patch)
tree0cb2ec0044b50e0e843c2188a44eb112711269e4 /fix-sizeof-use.patch
downloadaur-b883208c9753f7febef3803cc2e61261c14ed9c2.tar.gz
Initial commit
Diffstat (limited to 'fix-sizeof-use.patch')
-rw-r--r--fix-sizeof-use.patch30
1 files changed, 30 insertions, 0 deletions
diff --git a/fix-sizeof-use.patch b/fix-sizeof-use.patch
new file mode 100644
index 000000000000..a3d516e3a338
--- /dev/null
+++ b/fix-sizeof-use.patch
@@ -0,0 +1,30 @@
+Description: Fix sizeof(pointer) to be sizeof(buffer_pointed_to)
+Author: Olly Betts <olly@survex.com>
+Forwarded: no
+Last-Update: 2014-08-14
+
+--- a/src/vformat.c
++++ b/src/vformat.c
+@@ -1881,11 +1881,11 @@
+
+ //static unsigned char _evc_base64_rank[256];
+
+-static void base64_init(char *rank)
++static void base64_init(char *rank, size_t len)
+ {
+ int i;
+
+- memset(rank, 0xff, sizeof(rank));
++ memset(rank, 0xff, len);
+ for (i=0;i<64;i++) {
+ rank[(unsigned int)base64_alphabet[i]] = i;
+ }
+@@ -2011,7 +2011,7 @@
+ static size_t base64_decode_step(const unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save)
+ {
+ unsigned char base64_rank[256];
+- base64_init((char*)base64_rank);
++ base64_init((char*)base64_rank, sizeof(base64_rank));
+
+ register const unsigned char *inptr;
+ register unsigned char *outptr;