Adsk Contrib - Improve LUT loading#36
Conversation
Signed-off-by: Doug Walker <doug.walker@autodesk.com>
|
Just to note OpenColorIO/issues/2257 so as an extended solution we could consider the larger issue ideally I'd like to see the removal of the macro. |
|
I think there maybe another case to fix |
|
@KevinJW , I had seen that as well, but my understanding is that "%c" will only read a singe character, it's sort of like "%1s" (although not null-terminated). So it is already bounded and there is no way it could be used in a buffer-overrun attack. Am I missing something? |
|
I was thinking if the first %s was fed a few MB of none space characters, then valR would be overwritten and other things. Basically if we allow any length of "line" which I think we do then any un constrained %s can overflow. basically we should limit each and every %s with a maximum field width matching it's destination buffer's capacity - 1. See https://en.cppreference.com/cpp/io/c/fscanf
and
|
|
Actually by that statement there may be several other cases we need to fix up based on a simple scan of the code using |
I guess in some case we limit it to 4096, but that is bigger than 64, in others where we use std::string it is effectively unbounded I asked Gemini so find the easiest to mitigate issues and it found the same things but it identified a different approach to fixing them using some of our other utility code (sample from FileFormatSpi3D.cpp) it assumed we used |
|
Ah, ok, I thought you were commenting about the %c. As discussed in the TSC, this PR is only to apply the fixes that the external contributor requested. This PR will be separate so we are able to credit this other person. I'm not making any other fixes in this one. If you have any other suggestions, please make them in this other PR. In that PR, the lines you reference already have width limits on the %s, as follows: Regarding your Gemini code, I don't see any upside to making that change for 2.5.2. If you feel it is dramatically better, please propose it in a separate PR. |
|
Fair enough, I was thinking from the security point of view it is usually better to group all faults of a similar type in a single update, I had not cross referenced the two PRs in that way. |
|
Thanks for your understanding, Kevin. Sorry I was not clearer about the requirements for this PR. |
…#2304) Signed-off-by: Rémi Achard <remiachard@gmail.com>
…Foundation#2281) * Fix OpenGL ES type issues in ACES2 FixedFunction Ops Signed-off-by: Rémi Achard <remiachard@gmail.com> * Update src/OpenColorIO/ops/fixedfunction/FixedFunctionOpGPU.cpp Co-authored-by: Doug Walker <doug.walker@autodesk.com> Signed-off-by: Rémi Achard <remiachard@gmail.com> * Add 2D texture path tests for ACES2 cusp and reach table sampling Signed-off-by: Rémi Achard <remiachard@gmail.com> --------- Signed-off-by: Rémi Achard <remiachard@gmail.com> Co-authored-by: Doug Walker <doug.walker@autodesk.com>
No description provided.