diff options
author | tedu <tedu@openbsd.org> | 2014-12-17 22:23:33 +0000 |
---|---|---|
committer | tedu <tedu@openbsd.org> | 2014-12-17 22:23:33 +0000 |
commit | 0b75d96cf9200c719705a2094c0967d4899ff53b (patch) | |
tree | 9384c1da7f0c922eb0aa066b328be41c0baee646 /usr.sbin/tftpd | |
parent | unroll loops. much faster on amd64. ok deraadt millert (diff) | |
download | wireguard-openbsd-0b75d96cf9200c719705a2094c0967d4899ff53b.tar.xz wireguard-openbsd-0b75d96cf9200c719705a2094c0967d4899ff53b.zip |
the easier way to put a buffer on the stack is to put it on the stack,
not with alloca(). found by dickman; ok kettenis
Diffstat (limited to 'usr.sbin/tftpd')
-rw-r--r-- | usr.sbin/tftpd/tftpd.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/tftpd/tftpd.c b/usr.sbin/tftpd/tftpd.c index dd526f4c516..a579b7bf260 100644 --- a/usr.sbin/tftpd/tftpd.c +++ b/usr.sbin/tftpd/tftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tftpd.c,v 1.24 2014/11/25 23:52:09 dlg Exp $ */ +/* $OpenBSD: tftpd.c,v 1.25 2014/12/17 22:23:33 tedu Exp $ */ /* * Copyright (c) 2012 David Gwynne <dlg@uq.edu.au> @@ -645,7 +645,7 @@ tftpd_recv(int fd, short events, void *arg) client = client_alloc(); if (client == NULL) { - char *buf = alloca(SEGSIZE_MAX + 4); + char buf[SEGSIZE_MAX + 4]; /* no memory! flush this request... */ recv(fd, buf, SEGSIZE_MAX + 4, 0); /* dont care if it fails */ |