[segyio] 59/376: Compare buffer lengths unsigned

Jørgen Kvalsvik jokva-guest at moszumanska.debian.org
Wed Sep 20 08:04:07 UTC 2017


This is an automated email from the git hooks/post-receive script.

jokva-guest pushed a commit to branch debian
in repository segyio.

commit 5e3c9b3b1330058be164aabf3a6a0d55281c6192
Author: Jørgen Kvalsvik <jokva at statoil.com>
Date:   Wed Oct 19 14:12:30 2016 +0200

    Compare buffer lengths unsigned
---
 python/segyio/_segyio.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/python/segyio/_segyio.c b/python/segyio/_segyio.c
index ed8d3ee..92f4be2 100644
--- a/python/segyio/_segyio.c
+++ b/python/segyio/_segyio.c
@@ -593,7 +593,8 @@ static Py_buffer check_and_get_buffer(PyObject *object, const char *name, unsign
         return buffer;
     }
 
-    if (buffer.len < expected * sizeof(unsigned int)) {
+    size_t buffer_len = buffer.len;
+    if (buffer_len < expected * sizeof(unsigned int)) {
         PyErr_Format(PyExc_ValueError, "The destination for %s is too small. ", name);
         PyBuffer_Release(&buffer);
         return buffer;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/segyio.git



More information about the debian-science-commits mailing list