Issue 7449 - Signedness Conversion Issue
Summary: Signedness Conversion Issue
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: 2.4.33
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-22 06:01 UTC by tixu@cs.ucsd.edu
Modified: 2014-08-01 21:04 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description tixu@cs.ucsd.edu 2012-11-22 06:01:11 UTC
Full_Name: Tianyin Xu
Version: 2.4.33
OS: Ubuntu 12.04 (actually doesn't matter)
URL: 
Submission from: (NULL) (2607:f720:1300:1241:512c:f07a:5efe:8eda)


The data type of "index_substr_any_len" and "index_substr_any_step" are unsigned
int. They should share the same flag ARG_UINT as "index_substr_if_{min,max}len"

/* servers/slapd/schema_init.c */
158 unsigned int index_substr_if_minlen = SLAP_INDEX_SUBSTR_IF_MINLEN_DEFAULT;
159 unsigned int index_substr_if_maxlen = SLAP_INDEX_SUBSTR_IF_MAXLEN_DEFAULT;
160 unsigned int index_substr_any_len = SLAP_INDEX_SUBSTR_ANY_LEN_DEFAULT; 
161 unsigned int index_substr_any_step = SLAP_INDEX_SUBSTR_ANY_STEP_DEFAULT;

In the current code, they are "ARG_INT" which convert -1 to be 4294967295.

==========================PATCH=========================

@@ -399,13 +399,13 @@
        { "index_substr_if_maxlen", "max", 2, 2, 0,
ARG_UINT|ARG_NONZERO|ARG_MAGIC|CFG_SSTR_IF_MAX,
                &config_generic, "( OLcfgGlAt:21 NAME 'olcIndexSubstrIfMaxLen'
"
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
-       { "index_substr_any_len", "len", 2, 2, 0, ARG_INT|ARG_NONZERO,
+       { "index_substr_any_len", "len", 2, 2, 0, ARG_UINT|ARG_NONZERO,
                &index_substr_any_len, "( OLcfgGlAt:22 NAME
'olcIndexSubstrAnyLen' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
-       { "index_substr_any_step", "step", 2, 2, 0, ARG_INT|ARG_NONZERO,
+       { "index_substr_any_step", "step", 2, 2, 0, ARG_UINT|ARG_NONZERO,
                &index_substr_any_step, "( OLcfgGlAt:23 NAME
'olcIndexSubstrAnyStep' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
-       { "index_intlen", "len", 2, 2, 0, ARG_INT|ARG_MAGIC|CFG_IX_INTLEN,
+       { "index_intlen", "len", 2, 2, 0, ARG_UINT|ARG_MAGIC|CFG_IX_INTLEN,
                &config_generic, "( OLcfgGlAt:84 NAME 'olcIndexIntLen' "
                        "SYNTAX OMsInteger SINGLE-VALUE )", NULL, NULL },
        { "lastmod", "on|off", 2, 2, 0,
ARG_DB|ARG_ON_OFF|ARG_MAGIC|CFG_LASTMOD,
Comment 1 Howard Chu 2012-11-26 03:33:48 UTC
changed notes
changed state Open to Test
moved from Incoming to Software Bugs
Comment 2 Quanah Gibson-Mount 2012-11-26 22:35:18 UTC
changed notes
changed state Test to Release
Comment 3 Quanah Gibson-Mount 2013-03-05 02:19:27 UTC
changed notes
changed state Release to Closed
Comment 4 OpenLDAP project 2014-08-01 21:04:45 UTC
fixed in master
fixed in RE24