[PATCH 1/2] config: properly range-check integer values

2013-08-20 Thread Jeff King
When we look at a config value as an integer using the git_config_int function, we carefully range-check the value we get and complain if it is out of our range. But the range we compare to is that of a long, which we then cast to an int in the function's return value. This means that on systems

Re: [PATCH 1/2] config: properly range-check integer values

2013-08-20 Thread Jonathan Nieder
Jeff King wrote: I added a test. It would not fail on existing 32-bit systems, but would on existing LP64 systems. It will pass with the new code on both. However, it will fail on ILP64 systems (because their int is large, and can represent 3GB). I'm not sure if any such systems are in wide

Re: [PATCH 1/2] config: properly range-check integer values

2013-08-20 Thread Jeff King
On Tue, Aug 20, 2013 at 04:07:49PM -0700, Jonathan Nieder wrote: I added a test. It would not fail on existing 32-bit systems, but would on existing LP64 systems. It will pass with the new code on both. However, it will fail on ILP64 systems (because their int is large, and can represent