aboutsummaryrefslogtreecommitdiff
path: root/src/pl/plpython/plpy_elog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pl/plpython/plpy_elog.c')
-rw-r--r--src/pl/plpython/plpy_elog.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pl/plpython/plpy_elog.c b/src/pl/plpython/plpy_elog.c
index 2f04a8c0dba..f7d321289d4 100644
--- a/src/pl/plpython/plpy_elog.c
+++ b/src/pl/plpython/plpy_elog.c
@@ -367,6 +367,10 @@ get_source_line(const char *src, int lineno)
const char *next = src;
int current = 0;
+ /* sanity check */
+ if (lineno <= 0)
+ return NULL;
+
while (current < lineno)
{
s = next;