]> andersk Git - openssh.git/commitdiff
- markus@cvs.openbsd.org 2001/05/06 21:23:31
authormouring <mouring>
Tue, 8 May 2001 20:05:44 +0000 (20:05 +0000)
committermouring <mouring>
Tue, 8 May 2001 20:05:44 +0000 (20:05 +0000)
     [cli.c]
     cli_read() fails to catch SIGINT + overflow; from obdb@zzlevo.net

ChangeLog
cli.c

index f851cdbd939210a4d8c5f593976883525a424404..73d2bcfe7b8b49009a022e821eb107f1fe0a4a3f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+20010509
+  - OpenBSD CVS Sync
+   - markus@cvs.openbsd.org 2001/05/06 21:23:31
+     [cli.c]
+     cli_read() fails to catch SIGINT + overflow; from obdb@zzlevo.net
+
 20010508
  - (bal) Fixed configure test for USE_SIA.  
 
diff --git a/cli.c b/cli.c
index 4adde4beade6cfc08218983bf5d015ef5c0d75e8..6a58256906e46f71899985791cb95040641b6c13 100644 (file)
--- a/cli.c
+++ b/cli.c
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cli.c,v 1.12 2001/05/06 17:52:07 mouring Exp $        */
+/*     $OpenBSD: cli.c,v 1.13 2001/05/06 21:23:31 markus Exp $ */
 
 /*
  * Copyright (c) 2000 Markus Friedl.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: cli.c,v 1.12 2001/05/06 17:52:07 mouring Exp $");
+RCSID("$OpenBSD: cli.c,v 1.13 2001/05/06 21:23:31 markus Exp $");
 
 #include "xmalloc.h"
 #include "log.h"
@@ -141,15 +141,19 @@ cli_read(char* buf, int size, int echo)
 
        while (ch != '\n') {
                n = read(cli_input, &ch, 1);
+               if (intr)
+                       break;
                if (n == -1 && (errno == EAGAIN || errno == EINTR))
                        continue;
                if (n != 1)
                        break;
-               if (ch == '\n' || intr != 0)
+               if (ch == '\n')
                        break;
-               if (i < size)
+               if (i < size - 1)
                        buf[i++] = ch;
        }
+       if (intr)
+               i = 0;
        buf[i] = '\0';
 
        if (!echo)
This page took 0.047419 seconds and 5 git commands to generate.