[hackers] [surf][patch] Use signed chars for webext messages.

From: Noah Evans <clonex100_AT_protonmail.com>
Date: Fri, 08 Oct 2021 00:10:59 +0000

Plain chars are currently used for messaging, but sometimes negative values are sent, e.g. in scrollv. on x86 this doesn't cause a problem but chars are unsigned on my arm computer.

---
surf.c | 4 ++--
webext-surf.c | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/surf.c b/surf.c
index af0fa74..5d0dddd 100644
--- a/surf.c
+++ b/surf.c
_AT__AT_ -1222,7 +1222,7 @@ newview(Client *c, WebKitWebView *rv)
static gboolean
readsock(GIOChannel *s, GIOCondition ioc, gpointer unused)
{
- static char msg[MSGBUFSZ];
+ static signed char msg[MSGBUFSZ];
GError *gerr = NULL;
gsize msgsz;
_AT__AT_ -1856,7 +1856,7 @@ zoom(Client *c, const Arg *a)
static void
msgext(Client *c, char type, const Arg *a)
{
- static char msg[MSGBUFSZ];
+ static signed char msg[MSGBUFSZ];
int ret;
if (spair[0] < 0)
diff --git a/webext-surf.c b/webext-surf.c
index d087219..4056e07 100644
--- a/webext-surf.c
+++ b/webext-surf.c
_AT__AT_ -21,7 +21,7 @@ static int sock;
static void
msgsurf(guint64 pageid, const char *s)
{
- static char msg[MSGBUFSZ];
+ static signed char msg[MSGBUFSZ];
size_t sln = strlen(s);
int ret;
_AT__AT_ -38,7 +38,8 @@ msgsurf(guint64 pageid, const char *s)
static gboolean
readsock(GIOChannel *s, GIOCondition c, gpointer unused)
{
- static char js[48], msg[MSGBUFSZ];
+ static char js[48];
+ static signed char msg[MSGBUFSZ];
WebKitWebPage *page;
JSCContext *jsc;
GError *gerr = NULL;
--
2.33.0
Received on Fri Oct 08 2021 - 02:10:59 CEST

This archive was generated by hypermail 2.3.0 : Fri Oct 08 2021 - 02:12:34 CEST