The rule S836 is a Symbolic Execution rule, so it’s highly sensitive to the details of your code.
Without the original case in the form of a reproducer we cannot investigate the issue.
Note that a screenshot / a hand-redacted example is not going to reproduce the issue in most cases.
To generate the proper reproducer file:
Search in the analysis log for the full path of the source file for which you want to create a reproducer (the issue in this post). You will have to use exactly this name (same case, / or \…)
Add the reproducer option to the scanner configuration: sonar.cfamily.reproducer="Full path to the .cpp"
Re-run the scanner to generate a file named sonar-cfamily.reproducer in the project folder.
Please share this file. If you think this file contains private information, let us know, and we’ll send you a private message that will allow you to send it privately.