Yo Eric!

Commits:
0ecdf682 by Eric S. Raymond at 2017-05-11T14:10:41-04:00
Address Coverity CID 161765: Integer handling issues (SIGN_EXTENSION).

Bad patch:

../../libparse/binio.c: In function 'get_lsb_ulong':
../../libparse/binio.c:43:10: warning: conversion to 'long unsigned int' from 
'int' may change the sign of the result [-Wsign-conversion]
   retval |= *((*bufpp)++) << 8;
          ^~
../../libparse/binio.c:44:10: warning: conversion to 'long unsigned int' from 
'int' may change the sign of the result [-Wsign-conversion]
   retval |= *((*bufpp)++) << 16;
          ^~
../../libparse/binio.c:45:10: warning: conversion to 'long unsigned int' from 
'int' may change the sign of the result [-Wsign-conversion]
   retval |= *((*bufpp)++) << 24;
          ^~



RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        [email protected]  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
Title: GitLab

Eric S. Raymond pushed to branch master at NTPsec / ntpsec

Commits:

  • 0ecdf682
    by Eric S. Raymond at 2017-05-11T14:10:41-04:00
    Address Coverity CID 161765: Integer handling issues (SIGN_EXTENSION).
    
  • 42f1ca69
    by Eric S. Raymond at 2017-05-11T14:18:20-04:00
    Fix resource leaks in directory-walking code.
    
    Addresses Coverity CIDs 161765 and 161764.
    

2 changed files:

Changes:

  • libparse/binio.c
    ... ... @@ -37,14 +37,14 @@ get_lsb_ulong(
    37 37
     	unsigned char **bufpp
    
    38 38
     	)
    
    39 39
     {
    
    40
    -  long retval;
    
    40
    +  unsigned long retval;
    
    41 41
     
    
    42 42
       retval  = *((*bufpp)++);
    
    43 43
       retval |= *((*bufpp)++) << 8;
    
    44 44
       retval |= *((*bufpp)++) << 16;
    
    45 45
       retval |= *((*bufpp)++) << 24;
    
    46 46
     
    
    47
    -  return (unsigned long)retval;
    
    47
    +  return retval;
    
    48 48
     }
    
    49 49
     
    
    50 50
     void
    

  • ntpd/ntp_scanner.c
    ... ... @@ -408,10 +408,11 @@ bool lex_push_file(
    408 408
     			/* directory scanning */
    
    409 409
     			DIR *dfd;
    
    410 410
     			struct dirent *dp;
    
    411
    -			char **baselist = (char **)malloc(sizeof(char *));
    
    411
    +			char **baselist;
    
    412 412
     			int basecount = 0;
    
    413 413
     			if ((dfd = opendir(fullpath)) == NULL)
    
    414 414
     				return false;
    
    415
    +			baselist = (char **)malloc(sizeof(char *));
    
    415 416
     			while ((dp = readdir(dfd)) != NULL)
    
    416 417
     			{
    
    417 418
     			    if (!CONF_ENABLE(dp->d_name))
    
    ... ... @@ -420,6 +421,7 @@ bool lex_push_file(
    420 421
     			    baselist = realloc(baselist,
    
    421 422
                                            (size_t)(basecount+1) * sizeof(char *));
    
    422 423
     			}
    
    424
    +			closedir(dfd);
    
    423 425
     			qsort(baselist, (size_t)basecount, sizeof(char *),
    
    424 426
                                   rcmpstring);
    
    425 427
     			for (int i = 0; i < basecount; i++) {
    

  • _______________________________________________
    vc mailing list
    [email protected]
    http://lists.ntpsec.org/mailman/listinfo/vc
    

    Attachment: pgpHCr4feBOYn.pgp
    Description: OpenPGP digital signature

    _______________________________________________
    devel mailing list
    [email protected]
    http://lists.ntpsec.org/mailman/listinfo/devel

    Reply via email to