Loading source3/lib/debug.c +4 −3 Original line number Diff line number Diff line Loading @@ -208,8 +208,8 @@ static char *debug_list_class_names_and_levels(void) dim += l; } /* create single string list */ b = buf = malloc(dim); /* create single string list - add space for newline */ b = buf = malloc(dim+1); if (!buf) { err = True; goto done; Loading @@ -219,7 +219,8 @@ static char *debug_list_class_names_and_levels(void) strncpy(b, list[i], l); b = b + l; } b[-1] = '\0'; b[-1] = '\n'; /* replace last space with newline */ b[0] = '\0'; /* null terminate string */ done: /* free strings list */ Loading source3/utils/smbcontrol.c +9 −1 Original line number Diff line number Diff line Loading @@ -82,6 +82,14 @@ static void wait_replies(BOOL multiple_replies) } while (timeout - (time(NULL) - start_time) > 0); } /* Message handler callback that displays the PID and a string on stdout */ static void print_pid_string_cb(int msg_type, pid_t pid, void *buf, size_t len) { printf("PID %u: %.*s", (unsigned int)pid, (int)len, (const char *)buf); num_replies++; } /* Message handler callback that displays a string on stdout */ static void print_string_cb(int msg_type, pid_t pid, void *buf, size_t len) Loading Loading @@ -281,7 +289,7 @@ static BOOL do_debuglevel(const pid_t pid, const int argc, const char **argv) if (!send_message(pid, MSG_REQ_DEBUGLEVEL, NULL, 0, False)) return False; message_register(MSG_DEBUGLEVEL, print_string_cb); message_register(MSG_DEBUGLEVEL, print_pid_string_cb); wait_replies(pid == 0); Loading Loading
source3/lib/debug.c +4 −3 Original line number Diff line number Diff line Loading @@ -208,8 +208,8 @@ static char *debug_list_class_names_and_levels(void) dim += l; } /* create single string list */ b = buf = malloc(dim); /* create single string list - add space for newline */ b = buf = malloc(dim+1); if (!buf) { err = True; goto done; Loading @@ -219,7 +219,8 @@ static char *debug_list_class_names_and_levels(void) strncpy(b, list[i], l); b = b + l; } b[-1] = '\0'; b[-1] = '\n'; /* replace last space with newline */ b[0] = '\0'; /* null terminate string */ done: /* free strings list */ Loading
source3/utils/smbcontrol.c +9 −1 Original line number Diff line number Diff line Loading @@ -82,6 +82,14 @@ static void wait_replies(BOOL multiple_replies) } while (timeout - (time(NULL) - start_time) > 0); } /* Message handler callback that displays the PID and a string on stdout */ static void print_pid_string_cb(int msg_type, pid_t pid, void *buf, size_t len) { printf("PID %u: %.*s", (unsigned int)pid, (int)len, (const char *)buf); num_replies++; } /* Message handler callback that displays a string on stdout */ static void print_string_cb(int msg_type, pid_t pid, void *buf, size_t len) Loading Loading @@ -281,7 +289,7 @@ static BOOL do_debuglevel(const pid_t pid, const int argc, const char **argv) if (!send_message(pid, MSG_REQ_DEBUGLEVEL, NULL, 0, False)) return False; message_register(MSG_DEBUGLEVEL, print_string_cb); message_register(MSG_DEBUGLEVEL, print_pid_string_cb); wait_replies(pid == 0); Loading