mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-30 01:05:14 +02:00
- markus@cvs.openbsd.org 2001/05/12 19:53:13
[sftp-server.c] readlink does not NULL-terminate; mhe@home.se
This commit is contained in:
parent
6ef3964c79
commit
abbb73d089
@ -1,3 +1,9 @@
|
|||||||
|
20010517
|
||||||
|
- OpenBSD CVS Sync
|
||||||
|
- markus@cvs.openbsd.org 2001/05/12 19:53:13
|
||||||
|
[sftp-server.c]
|
||||||
|
readlink does not NULL-terminate; mhe@home.se
|
||||||
|
|
||||||
20010512
|
20010512
|
||||||
- OpenBSD CVS Sync
|
- OpenBSD CVS Sync
|
||||||
- markus@cvs.openbsd.org 2001/05/11 14:59:56
|
- markus@cvs.openbsd.org 2001/05/11 14:59:56
|
||||||
@ -5402,4 +5408,4 @@
|
|||||||
- Wrote replacements for strlcpy and mkdtemp
|
- Wrote replacements for strlcpy and mkdtemp
|
||||||
- Released 1.0pre1
|
- Released 1.0pre1
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.1218 2001/05/12 16:50:50 mouring Exp $
|
$Id: ChangeLog,v 1.1219 2001/05/17 03:14:57 mouring Exp $
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: sftp-server.c,v 1.25 2001/04/05 10:42:53 markus Exp $");
|
RCSID("$OpenBSD: sftp-server.c,v 1.26 2001/05/12 19:53:13 markus Exp $");
|
||||||
|
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
#include "bufaux.h"
|
#include "bufaux.h"
|
||||||
@ -883,18 +883,19 @@ void
|
|||||||
process_readlink(void)
|
process_readlink(void)
|
||||||
{
|
{
|
||||||
u_int32_t id;
|
u_int32_t id;
|
||||||
|
int len;
|
||||||
char link[MAXPATHLEN];
|
char link[MAXPATHLEN];
|
||||||
char *path;
|
char *path;
|
||||||
|
|
||||||
id = get_int();
|
id = get_int();
|
||||||
path = get_string(NULL);
|
path = get_string(NULL);
|
||||||
TRACE("readlink id %d path %s", id, path);
|
TRACE("readlink id %d path %s", id, path);
|
||||||
if (readlink(path, link, sizeof(link) - 1) == -1)
|
if ((len = readlink(path, link, sizeof(link) - 1)) == -1)
|
||||||
send_status(id, errno_to_portable(errno));
|
send_status(id, errno_to_portable(errno));
|
||||||
else {
|
else {
|
||||||
Stat s;
|
Stat s;
|
||||||
|
|
||||||
link[sizeof(link) - 1] = '\0';
|
link[len] = '\0';
|
||||||
attrib_clear(&s.attrib);
|
attrib_clear(&s.attrib);
|
||||||
s.name = s.long_name = link;
|
s.name = s.long_name = link;
|
||||||
send_names(id, 1, &s);
|
send_names(id, 1, &s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user