Update of /cvsroot/alsa/alsa-kernel/pci
In directory sc8-pr-cvs1:/tmp/cvs-serv27795

Modified Files:
        es1938.c 
Log Message:
memcpy -> copy_from_user in capture callback

Index: es1938.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/es1938.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- es1938.c    31 Jan 2003 15:20:19 -0000      1.22
+++ es1938.c    24 Mar 2003 09:01:45 -0000      1.23
@@ -829,11 +829,14 @@
        pos <<= chip->dma1_shift;
        count <<= chip->dma1_shift;
        snd_assert(pos + count <= chip->dma1_size, return -EINVAL);
-       if (pos + count < chip->dma1_size)
-               memcpy(dst, runtime->dma_area + pos + 1, count);
-       else {
-               memcpy(dst, runtime->dma_area + pos + 1, count - 1);
-               ((unsigned char *)dst)[count - 1] = runtime->dma_area[0];
+       if (pos + count < chip->dma1_size) {
+               if (copy_to_user(dst, runtime->dma_area + pos + 1, count))
+                       return -EFAULT;
+       } else {
+               if (copy_to_user(dst, runtime->dma_area + pos + 1, count - 1))
+                       return -EFAULT;
+               if (put_user(runtime->dma_area[0], ((unsigned char *)dst) + count - 1))
+                       return -EFAULT;
        }
        return 0;
 }



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to