[BACK]Return to readconf.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/readconf.c between version 1.199 and 1.200

version 1.199, 2013/05/16 04:27:50 version 1.200, 2013/05/16 09:12:31
Line 27 
Line 27 
 #include <stdio.h>  #include <stdio.h>
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   #include <util.h>
   
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "ssh.h"  #include "ssh.h"
Line 575 
Line 576 
                 if (strcmp(arg, "default") == 0) {                  if (strcmp(arg, "default") == 0) {
                         val64 = 0;                          val64 = 0;
                 } else {                  } else {
                         if (arg[0] < '0' || arg[0] > '9')                          if (scan_scaled(arg, &val64) == -1)
                                 fatal("%.200s line %d: Bad number.", filename,                                  fatal("%.200s line %d: Bad number '%s': %s",
                                     linenum);                                      filename, linenum, arg, strerror(errno));
                         orig = val64 = strtoll(arg, &endofnumber, 10);                          /* check for too-large or too-small limits */
                         if (arg == endofnumber)                          if (val64 > UINT_MAX)
                                 fatal("%.200s line %d: Bad number.", filename,  
                          linenum);  
                         switch (toupper(*endofnumber)) {  
                         case '\0':  
                                 scale = 1;  
                                 break;  
                         case 'K':  
                                 scale = 1<<10;  
                                 break;  
                         case 'M':  
                                 scale = 1<<20;  
                                 break;  
                         case 'G':  
                                 scale = 1<<30;  
                                 break;  
                         default:  
                                 fatal("%.200s line %d: Invalid RekeyLimit "  
                                     "suffix", filename, linenum);  
                         }  
                         val64 *= scale;  
                         /* detect integer wrap and too-large limits */  
                         if ((val64 / scale) != orig || val64 > UINT_MAX)  
                                 fatal("%.200s line %d: RekeyLimit too large",                                  fatal("%.200s line %d: RekeyLimit too large",
                                     filename, linenum);                                      filename, linenum);
                         if (val64 != 0 && val64 < 16)                          if (val64 != 0 && val64 < 16)

Legend:
Removed from v.1.199  
changed lines
  Added in v.1.200