Skip to content
Snippets Groups Projects
Commit e1399c8e authored by Christian Löpke's avatar Christian Löpke
Browse files

Added crash log from faulty buffer read.

parent 07a13989
Branches
No related tags found
No related merge requests found
...@@ -193,7 +193,9 @@ device_write(struct file *filp, const char *buff, size_t len, loff_t * off) ...@@ -193,7 +193,9 @@ device_write(struct file *filp, const char *buff, size_t len, loff_t * off)
else { else {
int i; int i;
for(i = 0; i < len; i++) //Save the given string for(i = 0; i < len; i++) //Save the given string
msg_username[i] = buff[i]; //Heres the CRASH get_user(msg_username[i], buff + i);
//msg_username[i] = buff[i]; //Heres the CRASH
//printk(KERN_INFO "Got %c at %d from %d bytes.\n", buff[i], i, (int)len);
for(i = len; i < USERBUF_LEN; i++) //Zeroing the rest of mem for(i = len; i < USERBUF_LEN; i++) //Zeroing the rest of mem
msg_username[i] = 0; msg_username[i] = 0;
printk(KERN_INFO "%s: Successfully got %d bytes!\n", printk(KERN_INFO "%s: Successfully got %d bytes!\n",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment