In dev_stdout_write, user_strdup_errno should be user_memdup_errno.
authorDan Cross <crossd@gmail.com>
Tue, 13 Sep 2016 19:26:52 +0000 (15:26 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Wed, 14 Sep 2016 13:26:51 +0000 (09:26 -0400)
We don't use the NUL terminator (presumably) copied by the strdup
variant, and it may not be valid anyway.

Change-Id: Ibce75aaaa8684f2ea5282c53ed8a546c7ff9b724
Signed-off-by: Dan Cross <crossd@gmail.com>
Signed-off-by: Barret Rhoden <brho@cs.berkeley.edu>
kern/src/devfs.c

index f2dcbb5..8e2af71 100644 (file)
@@ -100,7 +100,7 @@ ssize_t dev_stdout_write(struct file *file, const char *buf, size_t count,
        char *t_buf;
        struct proc *p = current;
        if (p)
-               t_buf = user_strdup_errno(p, buf, count);
+               t_buf = user_memdup_errno(p, buf, count);
        else
                t_buf = (char*)buf;
        if (!t_buf)