On an empty line terminated by \n, we would access the temporary buffer
(stack allocated) with an index of (uint32)-1. On 32bit machine this
would just read the byte before the array on the stack, but on 64bit it
would crash.
Check that the length is at least 1 before trying to access a character
in the array.
Fixes#13625.
Thanks to accessays for proofreading the code:
BTextControl was created with label as the first argument and NULL
as the second, while constructor expects control's name to come
first and then the label. The fix was to simply add a name
argument before the label and remove the extra NULL.
Fixes#13636.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* Added "read" argument, may change variable type in the future instead of just bool variable.
* Now search key's objectId is changed to found key's objectId.
Changed name BNode, BPath to Node, Path and move them into BTree
as the original names are already exist in Haiku Storage Kit.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* Removed redundant codes when mounting roots
* Added TRACE
* Finding root should be "FindExact" to make it more understandable.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* Replaced fStream by BNode, this might fix errors when handling BTree with multiple levels because fStream remains at leaf after first allocating.
* Changed search algorithm for items (linear search -> binary search)
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
Chunk tree objectID is 3,
256 is the objectID of first created subvolume in fs tree,
and also of first chunk tree (item in chunk tree).
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* Removed struct keyword for declaring variable.
* Renamed BPlusTree to BTree because BtrFS use a variant of BTree not B+Tree.
Signed-off-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
* stop the extractor processing before deleting the source.
* crash happened in MediaPlayer FilePlaylistItem::_CalculateDuration().
* was a regression introduced in hrev50671.
* fixes#13156.
We're still using the (now-deprecated) coreutils su, so this is
a replacement for that. It functions almost equivalently,
and supports the major arguments (-l, -c).
(Note that login/su to a non-root user is presently busted, though.
See #13583.)
It is too similar to the long format and does not add much value.
And it creates some problems with using a locale format with another's
string.
Fixes#11343.
The default error handling code in libpng uses setjmp/longjmp. This is
annoying, because stack variables may be corrupt, unless they are
declared volatile.
Instead of declaring everytihng volatile, we can tell libpng to use
custom error functions, which will throw a C++ exception, making the
code more readable and less crashy.
Also handle the png_read_end function returning errors without failing
the whole decoding. This happens for example in the old diskusage
documentation screenshots, where this function fails after the image was
completely and correctly decoded. Ignoring the error lets ShowImage show
these pictures.
Fixes the crash reported in #6775.