Bruno Randolf schrieb: >> >> @@ -766,6 +781,9 @@ static ssize_t read_file_queue(struct file *file, char >> __user *user_buf, len += snprintf(buf+len, sizeof(buf)-len, " len: %d\n", >> n); >> } >> >> + if (len > sizeof(buf)) >> + len = sizeof(buf); >> + >> return simple_read_from_buffer(user_buf, count, ppos, buf, len); >> } > > i think it would be better to make sure the buffer is always big enough to > hold all the output (it's not very variable in length), but as a safety net > this can't hurt. > glibc provides open_memstream()/fmemopen() to write into large buffers. I feel this as a better way than len += snprintf(buf+len) re, wh -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html