[Date Prev][Date Next] [Chronological] [Thread] [Top]

(ITS#4672) integerBitAndMatch fails for large integers

Full_Name: Andrew Bartlett
Version: 2.3.19
OS: Fedora Core 5
Submission from: (NULL) (

This test in schema_init.c:integerBitAndMatch

	lValue = SLAP_STRTOL(value->bv_val, NULL, 10);
	if(( lValue == SLAP_LONG_MIN || lValue == SLAP_LONG_MAX) &&
		errno == ERANGE )

Fails if lValue is SLAP_LONG_MIN/MAX (a valid input value), and errno in this
thread is already ERANGE

errno should be reset before this function

Also, if errno is reset, then we no longer need this test for LLONG_MIN/MAX,
which is not always present (needs c99)

#if defined(HAVE_STRTOLL) && defined(LLONG_MAX) \
	&& defined(LLONG_MIN) && defined(HAVE_LONG_LONG)

This would allow x86 Linux (I'm on Fedora Core 5) to then use strtoll(),
allowing larger numbers to be either operator or operand for bitop searches.