From 10f11a8d13c808713f979557a5c96fcaadacf92e Mon Sep 17 00:00:00 2001 From: Jaakko Keränen Date: Fri, 27 Nov 2020 09:25:53 +0200 Subject: DocumentWidget: Check for invalid deserialized URL Should check for stray pointers in URL, mostly to assist development use. Normally the "open" command arguments never have a pointer appended. --- src/ui/documentwidget.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/ui/documentwidget.c b/src/ui/documentwidget.c index ac07304d..a0dcb863 100644 --- a/src/ui/documentwidget.c +++ b/src/ui/documentwidget.c @@ -86,6 +86,10 @@ void serialize_PersistentDocumentState(const iPersistentDocumentState *d, iStrea void deserialize_PersistentDocumentState(iPersistentDocumentState *d, iStream *ins) { deserialize_String(d->url, ins); + if (indexOfCStr_String(d->url, " ptr:0x") != iInvalidPos) { + /* Oopsie, this should not have been written; invalid URL. */ + clear_String(d->url); + } /*d->zoomPercent =*/ read16_Stream(ins); deserialize_History(d->history, ins); } -- cgit v1.2.3