From 8010e3402be21de3db4937207d47542cc53d7247 Mon Sep 17 00:00:00 2001
From: Stefano Rivera <stefanor@debian.org>
Date: Mon, 4 Jan 2016 20:36:03 +0200
Subject: Allocate a buffer for zmq_getsockopt to write to

We can't just create a pointer, we need enough space to write the value.

Spotted with a pydebug build of cpython.

Forwarded: https://github.com/zeromq/pyzmq/pull/779
Patch-Name: allocate-buffer-zmq_getsockopt
---
 zmq/tests/test_cffi_backend.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/zmq/tests/test_cffi_backend.py b/zmq/tests/test_cffi_backend.py
index f51cad0..73b0c17 100644
--- a/zmq/tests/test_cffi_backend.py
+++ b/zmq/tests/test_cffi_backend.py
@@ -67,7 +67,7 @@ class TestCFFIBackend(TestCase):
         assert ret == 0
 
         option_len = ffi.new('size_t*', 3)
-        option = ffi.new('char*')
+        option = ffi.new('char[3]')
         ret = C.zmq_getsockopt(socket,
                             IDENTITY,
                             ffi.cast('void*', option),
