Hmmm… I just took another look and realized I missed the reassignment of the “p” pointer on line 577 (to depname) before p is used to modify the string. Sorry for the confusion. I don’t think there is a serious issue here. I could recommend changing line 557 to something like: const char * cp = strchr (nptr, ‘%’); and then changing all occurrences of p to cp up to line 574. This would keep the const pointer pure within the smaller scope and may help prevent someone in the future from attempting an invalid change. Just a suggestion. I realize it’s a pretty unimportant change. BTW: In another note, Jon Forrest responded to this thread. I’m not sure what that is about. Joe Sent from Mail for Windows From: Paul Smith On Sun, 2022-01-09 at 20:02 -0500, Joe Filion wrote: > If interested, I found another similar construct in another area of > the code. Don’t worry, this appears to be the last one. > > On line 557 of implicit.c: > p = strchr (nptr, '%'); > nptr is a const pointer, but p is used as a non-const pointer later > on and modifies the string. I see this line, but I don't see where p is used to modify the string. Maybe I am missing something? Can you show where the modification happens, not just the strchr()? |
- Re: Invalid use of const pointer? Henrik Carlqvist
- Re: Invalid use of const pointer? Paul Smith
- Re: Invalid use of const pointer? Henrik Carlqvist
- Re: Invalid use of const pointer? Paul Smith
- Re: Invalid use of const pointer? Henrik Carlqvist
- Re: Invalid use of const pointer? Edward Welbourne
- Re: Invalid use of const pointer? Paul Smith
- RE: Invalid use of const pointer? Joe Filion
- Re: Invalid use of const pointer? Paul Smith
- Re: Invalid use of const pointer? Jon Forrest
- RE: Invalid use of const pointer? Joe Filion
- Re: Invalid use of const pointer? Jon Forrest
- Re: Invalid use of const pointer? Paul Smith