-
Notifications
You must be signed in to change notification settings - Fork 61
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
Segfault while reading .editorconfig generated by JetBrains IDE #73
Comments
It looks like the packager did enable extra hardening options, I'd take this issue to https://bugs.opensuse.org |
My initial guess was that the quite long lines 31, 135, 153 and 171 were the problem. They all are over 2200 chars long. But apparently they were parsed just fine. The Currently in the specs is a hard limit of 50 for keys and 255 for values. There has been a discussion in editorconfig/editorconfig#429 to increase the fixed lengths in the specs, but that hasn't yet let to any merged PR at this moment. |
A easy way to reproduce it. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index d030664..05970b7 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -85,6 +85,9 @@ if(MSVC)
add_definitions("-J")
else()
add_definitions("-funsigned-char")
+ add_definitions("-D_FORTIFY_SOURCE=1")
+ add_definitions("-O2")
+ add_definitions("-Wall")
endif()
add_subdirectory(lib) |
Closes #73 Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
Closes #73 Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
While #74 avoids the overflow and resulting crash, it means that any of the affected keys are silently ignored or overwrite the values of other keys, which is a misbehaviour. While this only affects files which technically violate the specification, there's no way to tell those apart from valid ones. Please reconsider whether this issue is really fixed. |
@Vogtinator This is intended to be truncated. See the specification:
|
According to the specs it is fixed. See my comment above for the related issue and PRs about fixing the issue in the specs. Once the specs are updated the cores should be updated accordingly. |
No, it's clearly violating the spec. The spec says:
Truncation is the opposite of ignoring. In this case it assigns the values into a different key. |
Sorry for the confusion. I think you are right. The test is consistent with your interpretation of the specification (see the relevant lines in limits.in: the test case is testing whether the core library is properly ignoring the 51-char long key). The C core test is passing this test, which means that it has already been acting properly. The resolving PR merely fixed the overflow issue (the insufficiently allocated array size). |
I ran editorconfig through a debugger and can confirm that it's actually ignoring the keys properly indeed. Sorry for the noise and thanks for the quick fix! |
I've got segfault of Kate each time i'm trying to open any file in directory with .editorconfig, generated by JetBrains IDE
.editorconfig:
editorconfig.txt
Got this trace:
The text was updated successfully, but these errors were encountered: