patch-2.4.22 linux-2.4.22/fs/proc/proc_misc.c

Next file: linux-2.4.22/fs/quota.c
Previous file: linux-2.4.22/fs/proc/base.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/fs/proc/proc_misc.c linux-2.4.22/fs/proc/proc_misc.c
@@ -423,9 +423,9 @@
 				 int count, int *eof, void *data)
 {
 	extern char saved_command_line[];
-	int len;
+	int len = 0;
 
-	len = snprintf(page, count, "%s\n", saved_command_line);
+	proc_sprintf(page, &off, &len, "%s\n", saved_command_line);
 	return proc_calc_metrics(page, start, off, count, eof, len);
 }
 
@@ -495,7 +495,8 @@
 		buf++; p++; count--; read++;
 	}
 	pnt = (char *)prof_buffer + p - sizeof(unsigned int);
-	copy_to_user(buf,(void *)pnt,count);
+	if (copy_to_user(buf,(void *)pnt,count))
+		return -EFAULT;
 	read += count;
 	*ppos += read;
 	return read;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)