Merge branch '140-bufferedvalist-index-may-read-out-of-bounds' into 'master'

Resolve "BufferedVaList::index may read out of bounds"

Closes #140

See merge request redox-os/relibc!208
This commit is contained in:
jD91mZM2
2019-04-23 18:36:00 +00:00
5 changed files with 599 additions and 359 deletions
+15 -3
View File
@@ -1,5 +1,7 @@
#!/usr/bin/env bash
SUPRESS_ALL_THE_ERRORS=yes
set -e
include="$(realpath "$1")"
@@ -7,6 +9,10 @@ include="$(realpath "$1")"
cargo build --release --manifest-path cbindgen/Cargo.toml
cbindgen="$(realpath target/release/cbindgen)"
if [ "$SUPRESS_ALL_THE_ERRORS" = "yes" ]; then
echo -e "\e[91mNote: Warnings by cbindgen are suppressed in include.sh.\e[0m"
fi
jobs=()
for config in src/header/*/cbindgen.toml
do
@@ -15,10 +21,16 @@ do
if [ "${name:0:1}" != "_" ]
then
header="$include/${name/_//}.h"
pushd "$dir"
"$cbindgen" -c cbindgen.toml -o "$header" mod.rs &
pushd "$dir" > /dev/null
echo "$dir"
cbindgen_cmd='"$cbindgen" -c cbindgen.toml -o "$header" mod.rs'
if [ "$SUPRESS_ALL_THE_ERRORS" = "yes" ]; then
eval "$cbindgen_cmd" 2>&1 | (grep "^ERROR" -A 3 || true) &
else
eval "$cbindgen_cmd" &
fi
jobs+=($!)
popd
popd > /dev/null
fi
done
+577 -352
View File
File diff suppressed because it is too large Load Diff
-2
View File
@@ -151,8 +151,6 @@ impl Pal for Sys {
mut argv: *const *mut c_char,
mut envp: *const *mut c_char,
) -> c_int {
use alloc::vec::Vec;
let mut file = match File::open(path, fcntl::O_RDONLY | fcntl::O_CLOEXEC) {
Ok(file) => file,
Err(_) => return -1,
+3
View File
@@ -26,6 +26,9 @@ Positional madness:
4 3 2
00002
|Fiz |Buz | Fiz| Tot|
int: 5 double: 0.100000 0.200000 0.300000 0.400000
-1717986918 0.100000
-1717986918 0.200000
Float madness:
1.234568e+02
+4 -2
View File
@@ -1,7 +1,5 @@
#include <stdio.h>
#include "test_helpers.h"
int main(void) {
int sofar = 0;
int len = printf(
@@ -35,6 +33,10 @@ int main(void) {
printf("%3$d %2$d %1$d\n", 2, 3, 4);
printf("%.*3$d\n", 2, 0, 5);
printf("|%-*6$.*5$s|%-*6$.*5$s|%*6$.*5$s|%*6$.*5$s|\n", "Fizz", "Buzz", "FizzBuzz", "TotalBuzz", 3, 8);
printf("int: %*6$d double: %lf %lf %lf %lf\n", 5, 0.1, 0.2, 0.3, 0.4, 10);
printf("%1$d %1$lf\n", 5, 0.1);
printf("%1$d %lf\n", 5, 0.2);
//printf("int: %*6$d no info on middle types\n", 5, 0.1, 0.2, 0.3, 0.4, 10);
puts("\nFloat madness:");
printf("%20e\n", 123.456789123);