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

fix crash with variable SEQUENCE[n,m] #18106

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

zisoft
Copy link
Collaborator

@zisoft zisoft commented Dec 29, 2024

fixes #18100

The problem here is that a single-allocated string is handled as a two-field array where each element is released with g_free(), which of course crashes.

src/common/variables.c Outdated Show resolved Hide resolved
- remove non thread-safe strok()
- simplify the code because we only have [n] ($(IMAGE_ID[4])) or
  [n,m] ($(SEQUENCE[4,1])). This can easily be extended if there is
  more needed in the future
@zisoft
Copy link
Collaborator Author

zisoft commented Dec 30, 2024

  • remove non thread-safe strtok()
  • simplify the code because we only have [n] (i.e. $(IMAGE_ID[4])) or
    [n,m] (i.e. $(SEQUENCE[4,1])). This can easily be extended if there is
    more needed in the future

@zisoft zisoft added the bugfix pull request fixing a bug label Dec 30, 2024
@TurboGit TurboGit added this to the 5.0.1 milestone Jan 3, 2025
@TurboGit TurboGit added priority: high core features are broken and not usable at all, software crashes release notes: pending labels Jan 3, 2025
Copy link
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me, thanks!

@TurboGit TurboGit merged commit e932ddb into darktable-org:master Jan 3, 2025
6 checks passed
@TurboGit
Copy link
Member

TurboGit commented Jan 3, 2025

Merged in master and 5.0.x branch.

@zisoft
Copy link
Collaborator Author

zisoft commented Jan 4, 2025

Release notes:

Fixed a crash in variable expansion for $(SEQUENCE[n,m])

@zisoft zisoft deleted the fix-variables branch January 4, 2025 06:20
@TurboGit
Copy link
Member

TurboGit commented Jan 5, 2025

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix pull request fixing a bug priority: high core features are broken and not usable at all, software crashes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export photo with sequence(N,M) gives abort
3 participants