Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

config_set_allowed_to_delete_attrs: Valgrind reports Invalid read #997

Closed
389-ds-bot opened this issue Sep 12, 2020 · 5 comments
Closed
Labels
closed: fixed Migration flag - Issue
Milestone

Comments

@389-ds-bot
Copy link

Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/47660


==30037==
==30037== Invalid read of size 8
==30037== at 0x4C99384: config_set_allowed_to_delete_attrs (libglobs.c:6802)
==30037== by 0x4C99FE8: config_set (libglobs.c:7239)
==30037== by 0x11E7EA: load_config_dse (configdse.c:299)
==30037== by 0x4C7416B: dse_call_callback (dse.c:2421)
==30037== by 0x4C70734: dse_read_one_file (dse.c:799)
==30037== by 0x4C70A00: dse_read_file (dse.c:875)
==30037== by 0x12BE6E: init_dse_file (fedse.c:1612)
==30037== by 0x12C453: setup_internal_backends (fedse.c:1780)
==30037== by 0x12EAE9: main (main.c:840)
==30037== Address 0xe142338 is 8 bytes before a block of size 24 alloc'd
==30037== at 0x4A0887C: malloc (vg_replace_malloc.c:270)
==30037== by 0x4C61BD7: slapi_ch_malloc (ch_malloc.c:155)
==30037== by 0x4C6158E: slapi_str2charray_ext (charray.c:366)
==30037== by 0x4C992B0: config_set_allowed_to_delete_attrs (libglobs.c:6800)
==30037== by 0x4C99FE8: config_set (libglobs.c:7239)
==30037== by 0x11E7EA: load_config_dse (configdse.c:299)
==30037== by 0x4C7416B: dse_call_callback (dse.c:2421)
==30037== by 0x4C70734: dse_read_one_file (dse.c:799)
==30037== by 0x4C70A00: dse_read_file (dse.c:875)
==30037== by 0x12BE6E: init_dse_file (fedse.c:1612)
==30037== by 0x12C453: setup_internal_backends (fedse.c:1780)
==30037== by 0x12EAE9: main (main.c:840)

6784 int
6785 config_set_allowed_to_delete_attrs( const char *attrname, char *value,
6786                                     char *errorbuf, int apply )
   ...
6795     if (apply) {
6796         char *vcopy = slapi_ch_strdup(value);
6797         char **allowed = NULL, **s, *d;
6798         struct config_get_and_set *cgas = 0;
6799         int needcopy = 0;
6800         allowed = slapi_str2charray_ext(vcopy, " ", 0);
6801         for (s = allowed; s && *s; s++) ;
6802         for (--s; s && *s && (s >= allowed); s--) {
6803             cgas = (struct config_get_and_set *)PL_HashTableLookup(confighash,
6804                                                                    *s);

In the reported line 6802 for (--s; s && *s && (s >= allowed); s--) {,
the logic to stop the for loop should be "s && (s >= allowed) && *s"?

@389-ds-bot 389-ds-bot added the closed: fixed Migration flag - Issue label Sep 12, 2020
@389-ds-bot 389-ds-bot added this to the 1.3.1.18 milestone Sep 12, 2020
@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2014-01-11 03:45:30

Description: There was a logic error in checking the availability of
a pointer. Before checking the contents of an address, the correctness
of the pointer needed to be checked.

@389-ds-bot
Copy link
Author

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2014-01-14 01:06:41

git patch file (master) -- revised with fixing a memleak
0001-Ticket-47660-config_set_allowed_to_delete_attrs-Valg.2.patch

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2014-01-14 01:29:04

Reviewed by Rich (Thank you!!)

Pushed to master:
72520a2..1a788bf master -> master
commit 1a788bf

Pushed to 389-ds-base-1.3.2:
9a1b6da..22c24f0 389-ds-base-1.3.2 -> 389-ds-base-1.3.2
commit 22c24f0

Pushed to 389-ds-base-1.3.1:
bc5c678..4aa849f 389-ds-base-1.3.1 -> 389-ds-base-1.3.1
commit 4aa849f

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2017-02-11 22:56:07

Metadata Update from @nhosoi:

  • Issue assigned to nhosoi
  • Issue set to the milestone: 1.3.1.18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: fixed Migration flag - Issue
Projects
None yet
Development

No branches or pull requests

1 participant