wedesoft / anymeal

AnyMeal is a free and open source recipe management software developed using SQLite3 and Qt5. It can manage a cookbook with more than 250,000 MealMaster recipes, thereby allowing to import, export, search, display, edit, and print them. AnyMeal is available for GNU/Linux and Microsoft Windows.
https://wedesoft.github.io/anymeal
GNU General Public License v3.0
57 stars 5 forks source link

Undefined behavior when having longer recipe titles #60

Closed anzepintar closed 3 months ago

anzepintar commented 3 months ago

Undefined behavior when having character ž in recipe title: How to reproduce:

  1. option: Set aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa as title of the recipe and then click on button Show all recipes.
  2. option: Create new recipe with name containing 8 "ž" characters and then click on button Show all recipes 8ž = recipes.servings 9ž = recipes.servingsun . . . 16*ž = ����2e
wedesoft commented 3 months ago

Thanks for reporting this bug. Looks like I was using the return value of recipe.title().c_str() beyond it's lifetime!

wedesoft commented 3 months ago

Ok, fixed in version 1.31.