summaryrefslogtreecommitdiff
path: root/sftp.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2015-08-20 22:32:42 +0000
committerDamien Miller <djm@mindrot.org>2015-08-21 13:43:25 +1000
commitce445b0ed927e45bd5bdce8f836eb353998dd65c (patch)
tree34170a772ddf573879b8ae244bafd6871be0fd11 /sftp.c
parent05291e5288704d1a98bacda269eb5a0153599146 (diff)
upstream commit
Do not cast result of malloc/calloc/realloc* if stdlib.h is in scope ok krw millert Upstream-ID: 5e50ded78cadf3841556649a16cc4b1cb6c58667
Diffstat (limited to 'sftp.c')
-rw-r--r--sftp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sftp.c b/sftp.c
index cb9b967ed..788601a8d 100644
--- a/sftp.c
+++ b/sftp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sftp.c,v 1.170 2015/01/20 23:14:00 deraadt Exp $ */ 1/* $OpenBSD: sftp.c,v 1.171 2015/08/20 22:32:42 deraadt Exp $ */
2/* 2/*
3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org> 3 * Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
4 * 4 *
@@ -1958,7 +1958,7 @@ complete(EditLine *el, int ch)
1958 1958
1959 /* Figure out which argument the cursor points to */ 1959 /* Figure out which argument the cursor points to */
1960 cursor = lf->cursor - lf->buffer; 1960 cursor = lf->cursor - lf->buffer;
1961 line = (char *)xmalloc(cursor + 1); 1961 line = xmalloc(cursor + 1);
1962 memcpy(line, lf->buffer, cursor); 1962 memcpy(line, lf->buffer, cursor);
1963 line[cursor] = '\0'; 1963 line[cursor] = '\0';
1964 argv = makeargv(line, &carg, 1, &quote, &terminated); 1964 argv = makeargv(line, &carg, 1, &quote, &terminated);
@@ -1966,7 +1966,7 @@ complete(EditLine *el, int ch)
1966 1966
1967 /* Get all the arguments on the line */ 1967 /* Get all the arguments on the line */
1968 len = lf->lastchar - lf->buffer; 1968 len = lf->lastchar - lf->buffer;
1969 line = (char *)xmalloc(len + 1); 1969 line = xmalloc(len + 1);
1970 memcpy(line, lf->buffer, len); 1970 memcpy(line, lf->buffer, len);
1971 line[len] = '\0'; 1971 line[len] = '\0';
1972 argv = makeargv(line, &argc, 1, NULL, NULL); 1972 argv = makeargv(line, &argc, 1, NULL, NULL);