Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/5ea99617371386a99fe9d...
...commit
http://git.netsurf-browser.org/netsurf.git/commit/5ea99617371386a99fe9ddc...
...tree
http://git.netsurf-browser.org/netsurf.git/tree/5ea99617371386a99fe9ddc47...
The branch, master has been updated
via 5ea99617371386a99fe9ddc4759b310069ae8440 (commit)
from 80e9a23fc10b0749e3daede512557e7202e438bb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=5ea99617371386a99fe...
commit 5ea99617371386a99fe9ddc4759b310069ae8440
Author: John-Mark Bell <jmb(a)netsurf-browser.org>
Commit: John-Mark Bell <jmb(a)netsurf-browser.org>
RISCOS: further fix URL bar memory manipulation
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index 9dbb3a5..6003fe3 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -183,6 +183,7 @@ struct url_bar *ro_gui_url_bar_create(struct theme_descriptor *theme)
return NULL;
}
url_bar->text_buffer[0] = 0;
+ url_bar->text_buffer_utf8 = NULL;
url_bar->hidden = false;
@@ -516,6 +517,9 @@ void ro_gui_url_bar_destroy(struct url_bar *url_bar)
if (url_bar->text_buffer_utf8 != NULL)
free(url_bar->text_buffer_utf8);
+ if (url_bar->text_buffer != NULL)
+ free(url_bar->text_buffer);
+
free(url_bar);
}
@@ -981,8 +985,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
*/
if (strlen(local_url) >= url_bar->text_size) {
- strncpy(url_bar->text_buffer, "", url_bar->text_size - 1);
- url_bar->text_buffer[url_bar->text_size - 1] = '\0';
+ url_bar->text_buffer[0] = '\0';
warn_user("LongURL", NULL);
LOG("Long URL (%d chars): %s", strlen(url), url);
} else {
-----------------------------------------------------------------------
Summary of changes:
riscos/gui/url_bar.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/riscos/gui/url_bar.c b/riscos/gui/url_bar.c
index 9dbb3a5..6003fe3 100644
--- a/riscos/gui/url_bar.c
+++ b/riscos/gui/url_bar.c
@@ -183,6 +183,7 @@ struct url_bar *ro_gui_url_bar_create(struct theme_descriptor *theme)
return NULL;
}
url_bar->text_buffer[0] = 0;
+ url_bar->text_buffer_utf8 = NULL;
url_bar->hidden = false;
@@ -516,6 +517,9 @@ void ro_gui_url_bar_destroy(struct url_bar *url_bar)
if (url_bar->text_buffer_utf8 != NULL)
free(url_bar->text_buffer_utf8);
+ if (url_bar->text_buffer != NULL)
+ free(url_bar->text_buffer);
+
free(url_bar);
}
@@ -981,8 +985,7 @@ void ro_gui_url_bar_set_url(struct url_bar *url_bar, const char *url,
*/
if (strlen(local_url) >= url_bar->text_size) {
- strncpy(url_bar->text_buffer, "", url_bar->text_size - 1);
- url_bar->text_buffer[url_bar->text_size - 1] = '\0';
+ url_bar->text_buffer[0] = '\0';
warn_user("LongURL", NULL);
LOG("Long URL (%d chars): %s", strlen(url), url);
} else {
--
NetSurf Browser