From: tedu Date: Wed, 17 Dec 2014 22:23:33 +0000 (+0000) Subject: the easier way to put a buffer on the stack is to put it on the stack, X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=0b75d96cf9200c719705a2094c0967d4899ff53b;p=openbsd 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 --- 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 @@ -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 */