util: CID 1499409: Memory - corruptions (OVERLAPPING_COPY)
[samba.git] / lib / util / debug.c
index 784357e937058eab8eb1d9ba86cc4eb2562845c1..4143cb6058afc18c36f67ad1cc2601605ac268f3 100644 (file)
@@ -1741,8 +1741,9 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
                ensure_hostname();
                state.hs_len = snprintf(state.header_str,
                                        sizeof(state.header_str),
-                                       "%s %s %s[%u]: ",
+                                       "%s %.*s %s[%u]: ",
                                        tvbuf.buf,
+                                       (int)(sizeof(state.hostname) - 1),
                                        state.hostname,
                                        state.prog_name,
                                        (unsigned int) getpid());