summaryrefslogtreecommitdiff
path: root/chat/libotr
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2005-07-30 21:30:53 +0000
committerrillig <rillig@pkgsrc.org>2005-07-30 21:30:53 +0000
commitd930f8e32fe990541ecd176e7bef45575b5a8cb5 (patch)
treefacff23ae0ca9d76ab74fe78aff250b4cfc88723 /chat/libotr
parentc82661b8a8de730369f9d12a4b342ef7d27eaf37 (diff)
downloadpkgsrc-d930f8e32fe990541ecd176e7bef45575b5a8cb5.tar.gz
Added a patch to fix void* arithmetic.
Diffstat (limited to 'chat/libotr')
-rw-r--r--chat/libotr/distinfo3
-rw-r--r--chat/libotr/patches/patch-aa51
2 files changed, 53 insertions, 1 deletions
diff --git a/chat/libotr/distinfo b/chat/libotr/distinfo
index b9c320adb73..f3af828ebf9 100644
--- a/chat/libotr/distinfo
+++ b/chat/libotr/distinfo
@@ -1,5 +1,6 @@
-$NetBSD: distinfo,v 1.2 2005/07/27 19:17:35 gdt Exp $
+$NetBSD: distinfo,v 1.3 2005/07/30 21:30:53 rillig Exp $
SHA1 (libotr-2.0.2.tar.gz) = da8c0ce6bf23e65c094f003b8654f96be9c81b1b
RMD160 (libotr-2.0.2.tar.gz) = 8f35c5ac0ce5743bca075eb517119a85fce5351d
Size (libotr-2.0.2.tar.gz) = 368896 bytes
+SHA1 (patch-aa) = 5bd53e9eb7eeec29940debf63a0851c9197a5687
diff --git a/chat/libotr/patches/patch-aa b/chat/libotr/patches/patch-aa
new file mode 100644
index 00000000000..fff640cbfb9
--- /dev/null
+++ b/chat/libotr/patches/patch-aa
@@ -0,0 +1,51 @@
+$NetBSD: patch-aa,v 1.1 2005/07/30 21:30:53 rillig Exp $
+
+Don't do arithmetic with void pointers.
+
+--- src/mem.c.orig Fri Jan 21 16:02:03 2005
++++ src/mem.c Sat Jul 30 23:28:10 2005
+@@ -63,7 +63,7 @@ static void *otrl_mem_malloc(size_t n)
+ ((size_t *)p)[1] = OTRL_MEM_MAGIC;
+ #endif
+
+- return (p + header_size);
++ return (void *)((char *)p + header_size);
+ }
+
+ static int otrl_mem_is_secure(const void *p)
+@@ -73,7 +73,7 @@ static int otrl_mem_is_secure(const void
+
+ static void otrl_mem_free(void *p)
+ {
+- void *real_p = p - header_size;
++ void *real_p = (void *)((char *)p - header_size);
+ size_t n = ((size_t *)real_p)[0];
+ #ifdef OTRL_MEM_MAGIC
+ if (((size_t *)real_p)[1] != OTRL_MEM_MAGIC) {
+@@ -100,7 +100,7 @@ static void *otrl_mem_realloc(void *p, s
+ otrl_mem_free(p);
+ return NULL;
+ } else {
+- void *real_p = p - header_size;
++ void *real_p = (void *)((char *)p - header_size);
+ void *new_p;
+ size_t old_n = ((size_t *)real_p)[0];
+ #ifdef OTRL_MEM_MAGIC
+@@ -121,7 +121,7 @@ static void *otrl_mem_realloc(void *p, s
+
+ if (new_n < old_n) {
+ /* Overwrite the space we're about to stop using */
+- void *p = real_p + new_n;
++ void *p = (void *)((char *)real_p + new_n);
+ size_t excess = old_n - new_n;
+ memset(p, 0xff, excess);
+ memset(p, 0xaa, excess);
+@@ -136,7 +136,7 @@ static void *otrl_mem_realloc(void *p, s
+ }
+
+ ((size_t *)new_p)[0] = new_n; /* Includes header size */
+- return (new_p + header_size);
++ return (void *)((char *)new_p + header_size);
+ }
+ }
+