shithub: sox

Download patch

ref: f2204009a0af770e92b9527b198880b4724e8a1d
parent: e2d5e5bd63e3acfb99a91e1bf04cfb9d44a60441
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Thu Aug 17 15:26:15 EDT 2023

sox_effect_options: fix a sanitizer warning about NULL arg to memcpy

--- a/src/effects.c
+++ b/src/effects.c
@@ -80,7 +80,8 @@
 
   char * * argv2 = lsx_malloc((argc + 1) * sizeof(*argv2));
   argv2[0] = (char *)effp->handler.name;
-  memcpy(argv2 + 1, argv, argc * sizeof(*argv2));
+  if(argv != NULL)
+    memcpy(argv2 + 1, argv, argc * sizeof(*argv2));
   result = effp->handler.getopts(effp, argc + 1, argv2);
   free(argv2);
   return result;