Giter Site home page Giter Site logo

Comments (10)

ariccio avatar ariccio commented on May 14, 2024

(I'm pretty sure that) The problem is that the buffer is NOT correctly null-terminated.

from notepad-plus-plus.

rakekniven avatar rakekniven commented on May 14, 2024

Can confirm this too. Just upgraded from 6.7.5 to 6.7.7 and being unable to select cloud option.

from notepad-plus-plus.

ariccio avatar ariccio commented on May 14, 2024

My attempt at explaining this bug:
https://www.youtube.com/watch?v=D-mmjUhVDP8

It's actually fairly obvious if you run static analysis.

from notepad-plus-plus.

ariccio avatar ariccio commented on May 14, 2024

What makes it really bad, is that there's a:

    } catch (...) {
        //printStr(TEXT("JsonCpp exception captured"));
    }

block, which via SEH catches the access violation, and thus "can cause process corruption and lead to bugs that are hard to find and fix" makes Notepad++ more reliable.

Those kinds of "catch-all exceptions" blocks are in 12 places in Notepad++, eleven of which swallow the exception and continue, which silently corrupts the user's data makes life easier for users.

from notepad-plus-plus.

donho avatar donho commented on May 14, 2024

@Arbitel & @rakekniven
I'm working on fixing this issue.

from notepad-plus-plus.

ariccio avatar ariccio commented on May 14, 2024

Changing:

int base64ToAscii(char* dest, const char* base64Str)

to:

int base64ToAscii(_Post_z_ _Post_readable_size_( return ) char* dest, _In_z_ const char* base64Str)

...and applying my static analysis patch, yields:

C6054   Zero termination missing
    String 'dest' might not be zero-terminated
    812 This expression may not zero-terminate 'dest'
    841 Skip this loop, (assume 'i<nbLoop' is false)
    880 Skip this branch, (assume 'padd==b64_1padded' is false)
    883 Skip this branch, (assume 'padd==b64_2padded' is false)
    812 'dest' should be zero-terminated but may not be

For reference: C6054

Sure enough, if I set a breakpoint at line 887, and Start Debugging:
base64toascii_not_nullterminated

ignore the message in the output window that's bitching about allocating executable memory.

...and the string is not null-terminated, in exactly those conditions!

from notepad-plus-plus.

ariccio avatar ariccio commented on May 14, 2024

See: https://github.com/donho/notepad-plus-plus/pull/37

from notepad-plus-plus.

donho avatar donho commented on May 14, 2024

@ariccio If you were you, I would try to reproduce the bug, instead shooting (or shouting :) ) in the dark.
The bug has been fixed and the fix will be in the next release.

from notepad-plus-plus.

chadleong avatar chadleong commented on May 14, 2024

@donho Hmm, apparently it is still broken in 6.7.8.1

image

from notepad-plus-plus.

ariccio avatar ariccio commented on May 14, 2024

Proof that denying an issue doesn't make it go away.

from notepad-plus-plus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.