6 Commits
Author SHA1 Message Date
ohnx 452ac99fa7 mkdos: Handle memory allocation better
In the kernel and command-line tool, don't leak allocated memory,
even if the tool returns an error.

In the command-line tool, also handle memory allocation errors
nicely by giving the user an OOM message if allocation fails.

Fixes CID 1425367 and 1425224.

Signed-off-by: Augustin Cavalier <[email protected]>
2018-01-03 22:35:58 -05:00
ohnx 7766c048b3 libroot: Fix possible typo in printf_size.c
It appears as if there is a typo in printf_size.c; it makes
no sense to compare an unitialized variable in such a way.
Since `info->width` is referenced later on in the variable
assignment, it seems possible that the intended statement
was to place the larger of the values between `info->width`
and `info->prec` into `width`.

Fixes CID 609431.

korli: Patch applied in cddfcf2f87
was incomplete. This patch completes with what upstream did in 2004:
https://github.com/bminor/glibc/commit/fa5753eede3e97e94f50928989b313fb1fbdae6f.patch

Signed-off-by: Jérôme Duval <[email protected]>
2018-01-03 19:42:55 +01:00
ohnx e6c08856dd bin/compress: Remove.
Per #10267, "Most (ported) third-party software should be removed
from the Haiku source repository."

Since HaikuPorts already has the ncompress package, this file
should no longer exist.

Signed-off-by: Augustin Cavalier <[email protected]>
Original patch missed modifying the "minimum" definition and the
src/bin/Jamfile, so I took care of that.
2017-12-29 15:33:56 -05:00
ohnx d2f5cd017c WebPositive: Improve CookieWindow cookie deletion
Fixes Coverity issue CID 1340122.
Also resolves two TODO items in the code: allowing the deletion
of a selection of cookies, and deleting all cookies from a site
when there are no specific cookies selected.

Signed-off-by: Adrien Destugues <[email protected]>
2017-12-24 12:04:21 +01:00
ohnx 3934b3e6cc Add tests for calloc()
Signed-off-by: Augustin Cavalier <[email protected]>
2017-12-17 17:02:47 -05:00
Mason X 8a4744fbe4 Catch integer overflow in calloc (Fixes #13820)
calloc, when multiplying to find the true size of memory desired
by a user, will occasionally overflow if the numbers are too
large. This commit makes calloc ensure that the multiplication
does not overflow by dividing the result by one of the numbers,
and checking to ensure that the result is equal to the other
number. If there is overflow, it is treated as an OOM error.

Signed-off-by: Augustin Cavalier <[email protected]>
2017-12-17 17:02:09 -05:00