]> git.saurik.com Git - wxWidgets.git/blobdiff - src/stc/stc.h.in
Fix potential buffer overflow in wxSTC DefaultFont() function.
[wxWidgets.git] / src / stc / stc.h.in
index 1c980ab3cc145842b2c165caceea75f938a01495..b82bea900cc75810f89f1232e35f5499fec829c9 100644 (file)
@@ -319,7 +319,10 @@ public:
 
     */
 
-    virtual void SetInsertionPoint(long pos) { SetCurrentPos(pos); }
+    virtual void SetInsertionPoint(long pos)
+    {
+        SetCurrentPos(pos == -1 ? GetLastPosition() : pos);
+    }
     virtual long GetInsertionPoint() const { return GetCurrentPos(); }
     virtual long GetLastPosition() const { return GetTextLength(); }