search for: pr

Displaying 20 results from an estimated 10478 matches for "pr".

Did you mean: per
2017 Mar 18
0
[PATCH] python: check return value of Python APIs
Addressing issue #1406906. When constructing the returned objects, check the return value of Python APIs. This is especially relevant when dealing with non UTF-8 strings. A RuntimeError will be raised on failure pointing to the problematic entry and the field name. Signed-off-by: Matteo Cafasso <noxdafox@gmail.com> --- generator/python.ml | 143 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 97 insertions(+), 46 deletions(-) diff --git a/generator/python.ml b/generator/python.ml index 11dc48102...
2017 Apr 25
1
[Bug #1406906] [PATCH] python: fix segmentation fault when setting non UTF-8 strings
When constructing the returned objects, check the return value of Python APIs. A RuntimeError will be raised on failure pointing to the problematic entry and the field name. Signed-off-by: Matteo Cafasso <noxdafox@gmail.com> --- generator/python.ml | 143 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 97 insertions(+), 46 deletions(-) diff --git a/generator/python.ml b/generator/python.ml index 11dc48102...
2019 Aug 13
0
[PATCH libnbd 2/6] generator: Create only one Python wrapper per closure.
We were previously generating one instance of the Python closure wrapper per (function * Closure arg). However these wrappers didn't actually differ across functions. We can therefore save a lot of code by only generating one wrapper per closure globally. This reduces the amount of generated code by ne...
2018 May 03
1
[PATCH] daemon: fix memory allocation and leaks in OCaml stubs
.../generator/daemon.ml +++ b/generator/daemon.ml @@ -605,16 +605,18 @@ let generate_daemon_caml_stubs () = (* Implement code for returning structs and struct lists. *) let emit_return_struct typ = let struc = Structs.lookup_struct typ in + let uc_typ = String.uppercase_ascii typ in pr "/* Implement RStruct (%S, _). */\n" typ; pr "static guestfs_int_%s *\n" typ; pr "return_%s (value retv)\n" typ; pr "{\n"; - pr " guestfs_int_%s *ret;\n" typ; + pr " CLEANUP_FREE_%s guestfs_int_%s *ret = NULL;\n" uc_...
2019 Jun 27
0
Re: [PATCH 08/11] Rust bindings: Fix memory management and format the file
...rator/rust.ml | 461 +++++++++++++++++++++++++++++++--------------- 1 file changed, 311 insertions(+), 150 deletions(-) diff --git a/generator/rust.ml b/generator/rust.ml index 79e16dfc6..ee65b1073 100644 --- a/generator/rust.ml +++ b/generator/rust.ml @@ -61,14 +61,16 @@ let generate_rust () = pr " use std::collections; use std::convert; +use std::convert::TryFrom; use std::ffi; -use std::slice; +use std::os::raw::{c_char, c_int, c_void}; use std::ptr; -use std::os::raw::{c_char, c_int}; +use std::slice; +use std::str; #[allow(non_camel_case_types)] -enum guestfs_h {} // opaque...
2019 Jun 27
0
[PATCH 7/9] Rust bindings: Complete actions
...ator/rust.ml | 283 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 259 insertions(+), 24 deletions(-) diff --git a/generator/rust.ml b/generator/rust.ml index aa8b249ff..79e16dfc6 100644 --- a/generator/rust.ml +++ b/generator/rust.ml @@ -60,10 +60,11 @@ let generate_rust () = pr " use std::collections; +use std::convert; use std::ffi; use std::slice; use std::ptr; -use std::os::raw::c_char; +use std::os::raw::{c_char, c_int}; #[allow(non_camel_case_types)] @@ -74,6 +75,8 @@ extern \"C\" { fn guestfs_create() -> *mut guestfs_h; fn guestf...
2017 May 09
1
[PATCH v2] python: add simple wrappers for PyObject<->string functions
The current need for #ifdef's based on the presence of PyString_FromString makes both the OCaml code of the generator, and the generated C code a mess to read. Hence, add three simple wrappers to make both the OCaml, and C code more readable, and easier to tweak in the future. --- generator/python.ml | 72 ++++++++++++------------------------...
2019 Jul 24
0
[PATCH libnbd 1/3] generator: Change Closure so it describes single callbacks.
In preparation for closure lifetimes, split up the Closure so it no longer describes a list of closures, but a single callback. This changes the API because functions which take 2 or more closures now pass a separate user_data for each one. --- docs/libnbd.pod | 3 +- examples/str...
2009 Nov 19
1
[PATCH libguestfs] syntax-check: expand TABs in generator.ml
...+++++++++++++++----------------------- 1 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 2317541..c261ea2 100644 --- a/src/generator.ml +++ b/src/generator.ml @@ -5398,20 +5398,20 @@ check_state (guestfs_h *g, const char *caller) pr " /* caller will free this */\n"; pr " return safe_memdup (g, &ret.%s, sizeof (ret.%s));\n" n n | RBufferOut n -> - pr " /* RBufferOut is tricky: If the buffer is zero-length, then\n"; - pr " * _val might be NULL here. To mak...
2014 Aug 04
6
[hivex] Segfault for an integer value to node_set_value
Hi, When an integer argument is passed as value, node_set_value segfaults. Reproducer is at the end of this message The backtrace points at hivex-py.c, function get_value. While obj is non-NULL, `bytes = PyUnicode_AsUTF8String (obj);` returns NULL. Kind regards, Peter https://lekensteyn.nl #!/usr/bin/env python3 import hivex, sys h = hivex.Hivex(sys.argv[1]) print(h) val =...
2014 Aug 16
7
[hivex] [PATCH 0/6] Python fixes for node_set_value
Hi, This patch series is based on a prior patch[1], splitting off changes as requested and incorporating feedback from Richard Jones. It introduces type validation to avoid segmentation faults (instead, it reports an exception) and fixes handling of the bytes type in Python 3. Major changes since that series: - Drop newly introduced...
2016 Apr 11
1
[PATCH] RFC: php: support PHP 7
...RETURN_FALSE; } const char *err = guestfs_last_error (g); if (err) { - RETURN_STRING (err, 1); + GUESTFS_RETURN_STRING (err, 1); } else { RETURN_NULL (); } @@ -237,10 +284,10 @@ PHP_FUNCTION (guestfs_last_error) | BufferIn n | GUID n -> pr " char *%s;\n" n; - pr " int %s_size;\n" n + pr " guestfs_string_length %s_size;\n" n | OptString n -> pr " char *%s = NULL;\n" n; - pr " int %s_size;\n" n + pr " guestf...
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...Bs-as-indentation to spaces. Do it by running this command: [exempted files are matched via .x-sc_TAB_in_indentation] git ls-files \ | pcregrep -vf .x-sc_TAB_in_indentation \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_' --- HACKING | 50 +- appliance/libguestfs-supermin-helper.in | 4 +- appliance/supermin-split.sh.in | 24 +- bootstrap | 2 +- cat/virt-cat...
2019 Aug 14
5
[PATCH libnbd 0/3] Use free callback to hold ref to AIO buffer.
Basically the same as this patch series, but for Python: https://www.redhat.com/archives/libguestfs/2019-August/msg00235.html plus adding the 590 asynch test at the end. Rich.
2014 Dec 01
2
[PATCH v2] fish: show synopsis if command syntax is wrong
...onst char *synopsis; /* Synopsis. */ /* The run_* function. */ int (*run) (const char *cmd, size_t argc, char *argv[]); diff --git a/generator/fish.ml b/generator/fish.ml index 3f53ffa..52cdfd5 100644 --- a/generator/fish.ml +++ b/generator/fish.ml @@ -181,7 +181,7 @@ Guestfish will prompt for these separately." else "" in let pod = - sprintf "%s - %s\n\n=head1 SYNOPSIS\n\n %s\n\n=head1 DESCRIPTION\n\n%s%s%s" + sprintf "%s - %s\n\n=head1 SYNOPSIS\n\n%s\n\n=head1 DESCRIPTION\n\n%s%s%s" name2 shortdesc sy...
2019 Aug 13
12
[PATCH 0/6] Implement OClosure.
...ge but not significantly). I've run out of time on this patch today because I've got meetings for the rest of the day (and it's only 11am!) However if I did have more time there would be a 7th patch in the series which renames all aio_*_callback functions to simply aio_*. eg. nbd_aio_pread_callback is renamed to nbd_aio_pread (and old nbd_aio_pread is removed). That is obviously a somewhat large albeit it mechanical API change. Rich.
2019 Jul 16
0
[libnbd PATCH 2/2] RFC: generator: Handle shared callbacks in Python
[RFC because generated OCaml code needs the same treatment, but I ran out of time to play with that. At least 'make -C python check' passes, although coverage is not complete yet, as there is no python/t/5XX-pread-structured-callback.py...] [Also RFC because I'm not sure if the use of a record type for 'callback' is the best approach or most idiomatic OCaml - but hey, it taught me a lot about OCaml. Writing a 'string * callback list' proved to be a rather interesting exercise] Our C...
2017 May 11
1
[PATCH v2] RHBZ#1406906: check return value of Python object functions
Verify the returned values of Python Object constructor functions are not NULL before adding them to a collection. This is particularly relevant when constructing Unicode strings in Python 3 as they will return NULL if non UTF-8 characters are present. Signed-off-by: Matteo Cafasso <noxdafox@gmail.com> --- generator/python.ml | 102 ++++++++++++++++++++++++++--------------- python/handle.c | 36 ++++++++++++--- python/t/test830RHBZ1406906.py | 57 +++++++++++++++++++++++ 3 files changed, 152 insertions(+)...
2016 May 07
0
RV: Daily mail report for 2016-05-06lzq
Enviado desde mi smartphone BlackBerry Z10 4G Lte.   Mensaje original   De: admin at pr.copextel.com.cu Enviado: sábado, 7 de mayo de 2016 12:30 a.m. Para: admin at pr.copextel.com.cu Asunto: Daily mail report for 2016-05-06 Grand Totals ------------ messages 409 received 4135 delivered 0 forwarded 10 deferred (114 deferrals) 14 bounced 90 rejected (2%) 0 reject warnings 0 held 0 d...
2020 Sep 08
2
[libnbd PATCH] python: Plug some memory leaks on error paths
...cannot fail, makes it easier to clean up when the user passes wrong types to a function call. One of the easiest triggers without this patch was this one-liner: $ nbdsh -c 'h.block_status(512, 0, 1)' which fails due to '1' not being callable, but leaked malloc'd memory in the process. --- generator/Python.ml | 55 +++++++++++++++++++++++++++++---------------- 1 file changed, 36 insertions(+), 19 deletions(-) diff --git a/generator/Python.ml b/generator/Python.ml index 4a96cf6..9a22f9e 100644 --- a/generator/Python.ml +++ b/generator/Python.ml @@ -177,6 +177,7 @@ let prin...