~sircmpwn/visurf-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] nsvi: don't segfault on empty command

Details
Message ID
<20211231085846.18487-1-pranjal.kole7@gmail.com>
DKIM signature
missing
Download raw message
Patch: +6 -1
nsvi was segfaulting when an empty command was entered in exline, caused
by calling strlen on a null pointer.
---
 frontends/visurf/commands.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/frontends/visurf/commands.c b/frontends/visurf/commands.c
index 9600bde73..b244511d6 100644
--- a/frontends/visurf/commands.c
+++ b/frontends/visurf/commands.c
@@ -1326,7 +1326,12 @@ nsvi_command(void *user, const char *cmd)
			cmd_compar);
	if (!command) {
		NSLOG(netsurf, ERROR, "Invalid command '%s'", argv[0]);
		char *error_message = malloc(strlen(argv[0]) + 19);
		char *error_message;
		if (argv[0] != NULL) {
			error_message = malloc(strlen(argv[0]) + 19);
		} else {
			error_message = malloc(25);
		}
		sprintf(error_message, "Invalid command '%s'", argv[0]);
		handle_error(error_message);
		goto exit;
-- 
2.34.1
Details
Message ID
<CGTDKF5EP7Q2.2ZHHT2BVDOSLS@taiga>
In-Reply-To
<20211231085846.18487-1-pranjal.kole7@gmail.com> (view parent)
DKIM signature
missing
Download raw message
Thanks!

To git@git.sr.ht:~sircmpwn/visurf
   940de57e2..6be410ec3  master -> master
Reply to thread Export thread (mbox)