[PATCH] Fix crash when disabling auto commit

From: John Obaterspok <john(dot)obaterspok(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: [PATCH] Fix crash when disabling auto commit
Date: 2015-06-11 20:19:16
Message-ID: CAOscVdK1es0TKP8d5D6O3FYW6bZM+rsyz1_TkqdpG-bHzV+PLQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Fix crash when string has only alphas (like 'rollback')

diff --git a/pgadmin/frm/frmQuery.cpp b/pgadmin/frm/frmQuery.cpp
index b5a2f56..110bbc7 100644
--- a/pgadmin/frm/frmQuery.cpp
+++ b/pgadmin/frm/frmQuery.cpp
@@ -2522,7 +2522,7 @@ bool frmQuery::isBeginNotRequired(wxString query)
/*
* Check word length (since "beginx" is not "begin").
*/
- while(wxIsalpha(query.GetChar(wordlen)))
+ while(wordlen < query.Length() && wxIsalpha(query.GetChar(wordlen)))
wordlen++;

/*

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message John Obaterspok 2015-06-11 20:20:52 [PATCH] Add ElapsedTimeToString to format execution time in a more readable manner (instead of showing everything as msec)
Previous Message Ashesh Vashi 2015-05-27 09:56:25 Re: Fwd: PATCH: Format SQL (external tool)