From 64732b01e4e9720eaef181c631d94a509a73dc65 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Tue, 19 Jul 2011 10:01:46 -0700 Subject: connection: Use static strings instead of sprintf and buffer overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Spotted by Samuel Rødal --- wayland/connection.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/wayland/connection.c b/wayland/connection.c index af9a90e..467a2d0 100644 --- a/wayland/connection.c +++ b/wayland/connection.c @@ -692,20 +692,16 @@ void wl_closure_print(struct wl_closure *closure, struct wl_object *target, int send) { union wl_value *value; - char buffer[4] = "\0"; int i; struct timespec tp; unsigned int time; - if (send) - sprintf(buffer, " -> "); - clock_gettime(CLOCK_REALTIME, &tp); time = (tp.tv_sec * 1000000L) + (tp.tv_nsec / 1000); fprintf(stderr, "[%10.3f] %s%s@%d.%s(", time / 1000.0, - buffer, + send ? " -> " : "", target->interface->name, target->id, closure->message->name); -- cgit v1.2.3