mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-19 03:31:26 +00:00
scst_debug(): Avoid that debug_print_with_prefix() overflows the output buffer (merge r6339 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@6745 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -75,11 +75,11 @@ int debug_print_with_prefix(unsigned long trace_flag, const char *severity,
|
||||
|
||||
spin_lock_irqsave(&trace_buf_lock, flags);
|
||||
|
||||
strcpy(trace_buf, severity);
|
||||
strlcpy(trace_buf, severity, TRACE_BUF_SIZE);
|
||||
i = strlen(trace_buf);
|
||||
|
||||
if (trace_flag & TRACE_PID)
|
||||
i += snprintf(&trace_buf[i], TRACE_BUF_SIZE, "[%d]: ", pid);
|
||||
i += snprintf(&trace_buf[i], TRACE_BUF_SIZE - i, "[%d]: ", pid);
|
||||
if (prefix != NULL)
|
||||
i += snprintf(&trace_buf[i], TRACE_BUF_SIZE - i, "%s: ",
|
||||
prefix);
|
||||
|
||||
Reference in New Issue
Block a user