A corrupted record at a customer exposed this bug.
Arrays with nondefault bounds fail if either bound begins with 0 or 9.
diff --git a/pgmodule.c b/pgmodule.c
index 08ed188..6fd4635 100644
--- a/pgmodule.c
+++ b/pgmodule.c
@@ -664,11 +664,11 @@ cast_array(char *s, Py_ssize_t size, int encoding,
if (s == end || *s++ != '[') break;
while (s != end && *s == ' ') ++s;
if (s != end && (*s == '+' || *s == '-')) ++s;
- if (s == end || *s <= '0' || *s >= '9') break;
+ if (s == end || *s < '0' || *s > '9') break;
while (s != end && *s >= '0' && *s <= '9') ++s;
if (s == end || *s++ != ':') break;
if (s != end && (*s == '+' || *s == '-')) ++s;
- if (s == end || *s <= '0' || *s >= '9') break;
+ if (s == end || *s < '0' || *s > '9') break;
while (s != end && *s >= '0' && *s <= '9') ++s;
if (s == end || *s++ != ']') break;
while (s != end && *s == ' ') ++s;
_______________________________________________
PyGreSQL mailing list
[email protected]
https://mail.vex.net/mailman/listinfo/pygresql