[Github-comments] [geany/geany] Don't pass NULL to memcpy (PR #2960)

elextr notifications at xxxxx
Thu Oct 28 00:04:42 UTC 2021


@elextr commented on this pull request.



> @@ -694,7 +694,8 @@ static gboolean spawn_async_with_pipes(const gchar *working_directory, const gch
 			for (argc = 0; argv[argc]; argc++);
 
 		full_argv = g_renew(gchar *, cl_argv, cl_argc + argc + 1);
-		memcpy(full_argv + cl_argc, argv, argc * sizeof(gchar *));
+		if (argv)

Since the loop above will give argc == 0 if not argv the memcpy will not attempt to copy anything if not argv so its safe as is.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/2960#pullrequestreview-791261728
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211027/2e3991d0/attachment.htm>


More information about the Github-comments mailing list