summaryrefslogtreecommitdiff
path: root/frontends/riscos/gui/url_bar.c
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2022-06-03 02:41:23 +0100
committerJohn-Mark Bell <jmb@netsurf-browser.org>2022-06-03 02:41:23 +0100
commite1d7928b3bdd97b24f1ff7d2b04ab7a2a65ef460 (patch)
treeabef926dffcf9b17b0319703bd8eae887b2af21f /frontends/riscos/gui/url_bar.c
parent617c6207bcd45daa8d66c35dbc4f1273686646f3 (diff)
downloadnetsurf-e1d7928b3bdd97b24f1ff7d2b04ab7a2a65ef460.tar.gz
netsurf-e1d7928b3bdd97b24f1ff7d2b04ab7a2a65ef460.tar.bz2
RISC OS: fix snprintf usage
When computing throbber sprite names, ensure the current frame is in range before using it. Similarly ensure the buffer size for the temporary URL bar sprite name is sized such that snprintf has space for the trailing NUL when formatting it to the output buffer.
Diffstat (limited to 'frontends/riscos/gui/url_bar.c')
-rw-r--r--frontends/riscos/gui/url_bar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/frontends/riscos/gui/url_bar.c b/frontends/riscos/gui/url_bar.c
index ec21e9371..8802db731 100644
--- a/frontends/riscos/gui/url_bar.c
+++ b/frontends/riscos/gui/url_bar.c
@@ -1506,7 +1506,7 @@ ro_gui_url_bar_set_content_favicon(struct url_bar *url_bar,
struct gui_window *g)
{
int type = 0;
- char sprite[URLBAR_FAVICON_NAME_LENGTH];
+ char sprite[URLBAR_FAVICON_NAME_LENGTH-1];
struct hlcache_handle *h;
if (url_bar == NULL ||