xraypy / xraylarch

Larch: Applications and Python Library for Data Analysis of X-ray Absorption Spectroscopy (XAS, XANES, XAFS, EXAFS), X-ray Fluorescence (XRF) Spectroscopy and Imaging, and more.
https://xraypy.github.io/xraylarch
Other
133 stars 64 forks source link

XDI read of bad file causes seg fault #519

Closed jacobfilik closed 1 week ago

jacobfilik commented 3 months ago

larch version: 0.9.74

I am writing a web application using larch and XDI files, as part of my testing I have been sending incorrectly formed XDI files to the application.

A simple file containing just:

# XDI/1.0

Seems to make the XDI reader seg fault taking out the interpreter.

jacobfilik commented 3 months ago

Once an additional line is added, i.e.

# XDI/1.0\n#

An error is raised but the interpreter does not crash, suggesting its possibly just single line files causing the issue, which I can easily test for outside the library.

newville commented 3 months ago

@jacobfilik Thanks - I can certainly believe that a single file line was not included in the test suite! But of course, we should not be seg-faulting the interpreter when reading any file! Will investigate...

maurov commented 2 months ago

@jacobfilik this should be fixed in the latest release. Please, could you test and eventually close the issue?