Fix segmentation faults/core dumps on int/string 2 char conversion#4
Open
RobinR1 wants to merge 2 commits intoTeamScheire:masterfrom
Open
Fix segmentation faults/core dumps on int/string 2 char conversion#4RobinR1 wants to merge 2 commits intoTeamScheire:masterfrom
RobinR1 wants to merge 2 commits intoTeamScheire:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
De functies
int2charandstring2chargeven een pointer terug die naar een variabele gedefiniëerd in de scope van de respectievelijke functie zelf verwijst. Bijgevolg bestaat deze variabele niet meer tegen dat ze gebruikt wordt (meestal in de GD library). Dit kan leiden tot core dumps indien dat stukje geheugen intussen reeds overschreven is.Functie
string2chargeeft daarbovenop niets terug indien een lege string opgegeven wordt. In het geval van scheduled events kan het voorkomen dat de event-tekst leeg is (ok, de calender-backend zou dit mss moeten opvangen) waarop ook een core dump getriggered wordt indien de functie als parameter van een andere functie gebruikt wordt waardat een char* pointer verwacht wordt.Dit werd hier opgelost door de variabelen static te maken en in string2char een lege char terug te geven bij een lege input-string.