shithub: aubio

Download patch

ref: a2ab20a09888a88a7b58838474c13a29fa7188a7
parent: 386592474cb865541bdaf4be771003ada24e67d9
author: Paul Brossier <piem@piem.org>
date: Sat May 14 01:25:34 EDT 2016

python/ext/py-source.c: check seek is not negative

--- a/python/ext/py-source.c
+++ b/python/ext/py-source.c
@@ -251,8 +251,15 @@
 {
   uint_t err = 0;
 
-  uint_t position;
+  int position;
   if (!PyArg_ParseTuple (args, "I", &position)) {
+    return NULL;
+  }
+
+  if (position < 0) {
+    PyErr_Format(PyExc_ValueError,
+        "error when seeking in source: can not seek to negative value %d",
+        position);
     return NULL;
   }