From a3888d4941aaf3903c2406f739dd8cd9ed836dad Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Tue, 26 May 2009 10:13:31 -0400 Subject: Stop overwriting the stack Actually use the buffer not it's location on the stack. --- server/monitor/monitor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c index 2db233d8a..26c600705 100644 --- a/server/monitor/monitor.c +++ b/server/monitor/monitor.c @@ -1128,7 +1128,7 @@ static void config_file_changed(struct tevent_context *ev, total_len = 0; while (total_len < event_size) { - len = read(file_ctx->fd, &buf+total_len, event_size-total_len); + len = read(file_ctx->fd, buf+total_len, event_size-total_len); if (len == -1 && errno != EINTR) { DEBUG(0, ("Critical error reading inotify file descriptor.\n")); talloc_free(tmp_ctx); @@ -1137,7 +1137,7 @@ static void config_file_changed(struct tevent_context *ev, total_len += len; } - in_event = (struct inotify_event *)&buf; + in_event = (struct inotify_event *)buf; if (in_event->len > 0) { /* Read in the name, even though we don't use it, -- cgit