[exim-dev] [Bug 1224] testsuite fails for lsearch

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Phil Pennock
Dátum:  
Címzett: exim-dev
Tárgy: [exim-dev] [Bug 1224] testsuite fails for lsearch
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1224




--- Comment #3 from Phil Pennock <pdp@???> 2012-04-17 05:47:26 ---
Inline memory allocation, where a struct ends with a character array and the
storage allocated is sized to the struct plus the additional storage.

search.c:
524   else if (do_cache)
525     {
526     int len = keylength + 1;
527     t = store_get(sizeof(tree_node) + len);
528     memcpy(t->name, keystring, len);
529     t->data.ptr = data;
530     tree_insertnode(&c->item_cache, t);
531     }


The format of the data used as the key, in looking up the filename, is at:

353 sprintf(CS keybuffer, "%c%.254s", search_type + '0',
354 (filename == NULL)? US"" : filename);

Thus, as discussed with Jeremy, this is showing a ':' simply because ':' is
after '9' in ASCII, and the test suite currently assumes a fixed set of lookup
types and is not resilient to Exim being built with a different set of lookups.
The fix, which I believe Jeremy is preparing / has prepared, is to
canonicalise the lookup type index to some dummy value (eg, '0').


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email