1. 20 Jan, 2011 2 commits
  2. 19 Jan, 2011 3 commits
  3. 18 Jan, 2011 1 commit
  4. 13 Jan, 2011 1 commit
  5. 12 Jan, 2011 1 commit
  6. 11 Jan, 2011 10 commits
  7. 10 Jan, 2011 1 commit
  8. 08 Jan, 2011 5 commits
  9. 07 Jan, 2011 4 commits
  10. 06 Jan, 2011 4 commits
  11. 05 Jan, 2011 1 commit
  12. 03 Jan, 2011 2 commits
  13. 01 Jan, 2011 5 commits
    • Moe Jette's avatar
      c5911e61
    • Moe Jette's avatar
      Patch from Gerrit: 09_hostlist__hostlist_deranged_string.diff · 8274e453
      Moe Jette authored
      hostlist_deranged_string(): test for overflow
      			    
      This builds upon the preceding patch, exploiting that hostrange_to_string()
       * returns >= 0 when it has terminated the string with '\0', where  either 
         - n == 0 and it has not written anything or
         - it has written at most n > 0 characters, indicated by returning  n-1 >= 0;
       * returns a negative value to indicate truncation.
      
      Hence hostrange_deranged_string() changed as follows:
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       * added 'len < n' as loop condition, to catch the case 'n == 0'
         (also exploiting that NUL-termination is only needed on error);
       * separator now is inserted after all non-first elements
         (to avoid having to undo the last separator);
       * as in preceding patch, replaced 'truncated' variable by a jump label.
      8274e453
    • Moe Jette's avatar
      patch from Gerrit: 08_hostlist__hostrange_to_string.diff · e2bc04b5
      Moe Jette authored
      hostrange_to_string(): truncation checks
      
       * turned 'truncated' variable into jump label;
       * loop changes so that the pre-condition is always len < n:
         - if len >= n inside the loop, the a jump to 'truncated' follows,
         - hence loop post-condition is also len < n, so that buf[len] = '\0' works;
       * consistently check ret=snprintf() for "ret < 0 || (len += ret) >= n",
         - if dims > 1, also tests to ensure that len + dims < n,
         - further overflow test after incrementing len for  separator;
       * moved separator test up (inserted when i > hr->lo)
         (to avoid having to undo the last separator).
      e2bc04b5
    • Moe Jette's avatar
      patch from Gerrit: 07_hostlist__hostrange_pop__hostrange_shift.diff · a9f9ff68
      Moe Jette authored
      hostrange_pop()/hostrange_shift(): test for overflow
      
      hostrange_pop():				   
       * retrofitted out_of_memory() test after strdup;
       * tested for negative length/overflow before the while-loop,
         making sure that 'dims' characters also fit in;
       * second snprintf is not tested.
      
      hostrange_shift(): 
       * analogous changes (second snprintf also not tested). 
      a9f9ff68
    • Moe Jette's avatar
      Patch from Gerrit: 06_hostlist__host_prefix_end.diff · c5918ee9
      Moe Jette authored
      host_prefix_end(): save variable, factor out common expressions
      
      This saves one variable and factors out the condition common
      to the if/else branches.06_hostlist__host_prefix_end.diff
      
       * return type of strlen is unsigned (size_t), hence strlen(hostname) >= 0;
       * both while-loops require idx >= 0, hence -1 is returned
         if strlen(hostname) == 0.
      c5918ee9