INN commit: trunk/tests (6 files)

Russ Allbery rra at stanford.edu
Wed Aug 1 18:19:20 UTC 2007


Thank you so much for all your work!

INN Commit <Russ_Allbery at isc.org> writes:

> Modified: lib/hstrerror-t.c
> ===================================================================
> --- lib/hstrerror-t.c	2007-08-01 13:07:24 UTC (rev 7615)
> +++ lib/hstrerror-t.c	2007-08-01 13:50:05 UTC (rev 7616)
> @@ -25,8 +25,8 @@
>      test_error(3, "No address associated with name", NO_ADDRESS);
>      test_error(4, "Resolver error 777777", 777777);
>      test_error(5, "Resolver error -99999", -99999);
> -    test_error(6, "", 1000000);
> -    test_error(7, "", -100000);
> +    test_error(6, "Resolver error 1000000", 1000000);
> +    test_error(7, "Resolver error -100000", -100000);
>  
>      return 0;
>  }

The intention of this test was to overflow the internal buffer used in
hstrerror for unknown error codes and test that it handles that properly
rather than writing past the end of the buffer.  The problem is that I
miscounted and those last two error strings are only 22 characters, not 32
characters (which would overflow the buffer).  I'm not sure you can
overflow that buffer on a 32-bit machine, and I see from inspection that
what would actually happen is that the error message would be truncated.

You could probably just drop those last two tests; I don't think they're
doing anything for us.

-- 
Russ Allbery (rra at stanford.edu)             <http://www.eyrie.org/~eagle/>


More information about the inn-workers mailing list