search for: strv

Displaying 20 results from an estimated 61 matches for "strv".

Did you mean: str
2018 Feb 15
0
[PATCH] Introduce a wrapper around xmlParseURI.
...ibxml/xpathInternals.h> #include <libxml/uri.h> +#include "libxml2-utils.h" + #pragma GCC diagnostic ignored "-Wmissing-prototypes" /* xmlDocPtr type */ @@ -426,16 +430,11 @@ mllib_xml_doc_get_root_element (value docv) } } -value -mllib_xml_parse_uri (value strv) +static value +Val_uri (xmlURIPtr uri) { - CAMLparam1 (strv); + CAMLparam0 (); CAMLlocal3 (rv, sv, ov); - xmlURIPtr uri; - - uri = xmlParseURI (String_val (strv)); - if (uri == NULL) - caml_invalid_argument ("parse_uri: unable to parse URI"); rv = caml_alloc_tuple (9);...
2019 Mar 29
0
[PATCH v2 1/3] common/mlpcre: add offset flag for PCRE.matches
...(Field (intv, 0)); +} + value guestfs_int_pcre_compile (value anchoredv, value caselessv, value dotallv, value extendedv, value multilinev, @@ -165,9 +174,9 @@ guestfs_int_pcre_compile_byte (value *argv, int argn) } value -guestfs_int_pcre_matches (value rev, value strv) +guestfs_int_pcre_matches (value offsetv, value rev, value strv) { - CAMLparam2 (rev, strv); + CAMLparam3 (offsetv, rev, strv); pcre *re = Regexp_val (rev); struct last_match *m, *oldm; size_t len = caml_string_length (strv); @@ -205,7 +214,8 @@ guestfs_int_pcre_matches (value rev, val...
2019 Feb 25
0
[PATCH 1/3] common/mlpcre: add offset flag for PCRE.matches
...(Field (intv, 0)); +} + value guestfs_int_pcre_compile (value anchoredv, value caselessv, value dotallv, value extendedv, value multilinev, @@ -165,9 +174,9 @@ guestfs_int_pcre_compile_byte (value *argv, int argn) } value -guestfs_int_pcre_matches (value rev, value strv) +guestfs_int_pcre_matches (value offsetv, value rev, value strv) { - CAMLparam2 (rev, strv); + CAMLparam3 (offsetv, rev, strv); pcre *re = Regexp_val (rev); struct last_match *m, *oldm; size_t len = caml_string_length (strv); @@ -205,7 +214,8 @@ guestfs_int_pcre_matches (value rev, val...
2018 Nov 02
0
[PATCH REPOST] Introduce a wrapper around xmlParseURI.
...ibxml/xpathInternals.h> #include <libxml/uri.h> +#include "libxml2-utils.h" + #pragma GCC diagnostic ignored "-Wmissing-prototypes" /* xmlDocPtr type */ @@ -426,16 +430,11 @@ mllib_xml_doc_get_root_element (value docv) } } -value -mllib_xml_parse_uri (value strv) +static value +Val_uri (xmlURIPtr uri) { - CAMLparam1 (strv); + CAMLparam0 (); CAMLlocal3 (rv, sv, ov); - xmlURIPtr uri; - - uri = xmlParseURI (String_val (strv)); - if (uri == NULL) - caml_invalid_argument ("parse_uri: unable to parse URI"); rv = caml_alloc_tuple (9);...
2017 Dec 12
1
[PATCH] Introduce a wrapper around xmlParseURI.
An alternate solution to: https://www.redhat.com/archives/libguestfs/2017-December/msg00035.html "[PATCH] v2v: -i vmx: Allow ssh URLs to use spaces." is to classify all URLs processed by libguestfs as either ordinary URLs or the special non-standard URLs that we use for things like ‘virt-v2v -i vmx’ and ‘guestfish --add’. For the non-standard URLs, provide a wrapper around
2018 Nov 02
2
[PATCH REPOST] Introduce a wrapper around xmlParseURI.
Previously posted: https://www.redhat.com/archives/libguestfs/2017-December/msg00046.html Rich.
2017 Jan 27
2
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...n) is a short piece of asm which preserves errno. However you'll need to save errno around caml_enter_blocking_section since that unblocks and processes signals. IOW: static int pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset) { CAMLparam0 (); CAMLlocal3 (rv, strv, offsetv); + int saved_errno; ... rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv); + saved_errno = errno; if (Is_exception_result (rv)) { nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); caml_enter_blocking_section (); + errn...
2019 Apr 23
0
[PATCH nbdkit v2 1/2] ocaml: Change pread method to avoid leaking heap memory.
...git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c index d854f48..39704e2 100644 --- a/plugins/ocaml/ocaml.c +++ b/plugins/ocaml/ocaml.c @@ -439,15 +439,16 @@ pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset, uint32_t flags) { CAMLparam0 (); - CAMLlocal4 (rv, strv, offsetv, flagsv); + CAMLlocal4 (rv, countv, offsetv, flagsv); + mlsize_t len; caml_leave_blocking_section (); - strv = caml_alloc_string (count); + countv = caml_copy_int32 (count); offsetv = caml_copy_int64 (offset); flagsv = Val_flags (flags); - value args[] = { *(value *) h,...
2017 Feb 07
0
[PATCH v2 2/7] Move xml and xpath_helpers OCAML code to mllib
...ue recursivev) { CAMLparam2 (docv, recursivev); CAMLlocal1 (copyv); @@ -147,7 +148,7 @@ v2v_xml_copy_doc (value docv, value recursivev) } value -v2v_xml_to_string (value docv, value formatv) +mllib_xml_to_string (value docv, value formatv) { CAMLparam2 (docv, formatv); CAMLlocal1 (strv); @@ -166,7 +167,7 @@ v2v_xml_to_string (value docv, value formatv) } value -v2v_xml_xpath_new_context (value docv) +mllib_xml_xpath_new_context (value docv) { CAMLparam1 (docv); CAMLlocal1 (xpathctxv); @@ -186,7 +187,7 @@ v2v_xml_xpath_new_context (value docv) } value -v2v_xml_xpath...
2019 Mar 29
5
[PATCH v2 0/3] v2v: add -o json output mode
This series adds a new output mode for virt-v2v, called -o json. It produces local files, just like -o local, although the metadata produced is a JSON file with data that v2v collected in the conversion process. This can be useful for converting to unsupported destinations, still based on QEMU/KVM. In addition to a simple different metadata, it offers a way to relocate the disks, with
2019 Apr 23
4
[PATCH nbdkit 0/2] Be careful not to leak heap memory to the client.
This bug was found by Eric Blake. In the .pread method we allocate a buffer in the server and pass it to the plugin. The plugin is supposed to fill it with data. The buffer was uninitialized so initially contained random heap data, but that's OK provided the plugin fully overwrote it with data. All correctly written plugins ought to do this, however there is the possibility of an
2017 Jan 27
0
Re: [nbdkit PATCH v3 1/4] plugins: Don't use bogus errno from non-C plugins
...> However you'll need to save errno around caml_enter_blocking_section > since that unblocks and processes signals. > > IOW: > > static int > pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset) > { > CAMLparam0 (); > CAMLlocal3 (rv, strv, offsetv); > + int saved_errno; > ... > rv = caml_callback3_exn (pread_fn, *(value *) h, strv, offsetv); > + saved_errno = errno; > if (Is_exception_result (rv)) { > nbdkit_error ("%s", caml_format_exception (Extract_exception (rv))); > caml_en...
2018 Apr 27
1
[PATCH] common/mlpcre: fix access to freed memory
...-- common/mlpcre/pcre-c.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c index da982025f..0762a8341 100644 --- a/common/mlpcre/pcre-c.c +++ b/common/mlpcre/pcre-c.c @@ -207,8 +207,9 @@ guestfs_int_pcre_matches (value rev, value strv) m->r = pcre_exec (re, NULL, m->subject, len, 0, 0, m->vec, veclen); if (m->r < 0 && m->r != PCRE_ERROR_NOMATCH) { + int ret = m->r; free_last_match (m); - raise_pcre_error ("pcre_exec", m->r); + raise_pcre_error ("pcre_exec"...
2019 Apr 23
0
[PATCH nbdkit 1/2] ocaml: Initialize pread buffer with zeroes to avoid leaking heap memory.
...changed, 4 insertions(+) diff --git a/plugins/ocaml/ocaml.c b/plugins/ocaml/ocaml.c index d854f48..7193842 100644 --- a/plugins/ocaml/ocaml.c +++ b/plugins/ocaml/ocaml.c @@ -444,6 +444,10 @@ pread_wrapper (void *h, void *buf, uint32_t count, uint64_t offset, caml_leave_blocking_section (); strv = caml_alloc_string (count); + /* Initialize the buffer with zeroes in case the plugin does not + * fill it completely. + */ + memset (String_val (strv), 0, count); offsetv = caml_copy_int64 (offset); flagsv = Val_flags (flags); -- 2.20.1
2017 Feb 22
4
[PATCH 0/3] v2v: vCenter: Remove proxy environment variables
Fix for: https://bugzilla.redhat.com/show_bug.cgi?id=1354507 Main explanation is in patch #3. Rich.
2017 Jun 16
2
compil error samba 3.6.5
...k: cc_link crc32_1.o,hmacmd5_1.o,md4_1.o,arcfour_1.o,sha256_1.o,sha5 12_1.o,hmacsha256_1.o,aes_1.o,rijndaelalg-fst_1.o,aes_cmac_128_1.o,aes_ccm_128_ 1.o,aes_gcm_128_1.o,codepoints_2.o,convert_string_2.o,util_str_2.o,util_unistr_w _2.o,pull_push_2.o,util_unistr_2.o,weird_2.o,charset_macosxfs_2.o,strv_6.o,iconv _1.o,dynconfig_1.o,data_blob_20.o,util_file_20.o,time_20.o,signal_20.o,util_20.o ,idtree_20.o,fault_20.o,substitute_20.o,util_process_20.o,util_strlist_20.o,strv _util_20.o,talloc_stack_32.o,smb_threads_32.o,rbtree_32.o,rfc1738_32.o,become_da emon_32.o,system_32.o,select_32.o,getpass_...
2019 Apr 23
4
[PATCH nbdkit v2 0/2] Be careful not to leak server heap memory to the client.
Version 1 was here: https://www.redhat.com/archives/libguestfs/2019-April/msg00144.html Version 2 makes a couple of much larger changes: The OCaml patch changes the API of the pread method so it matches what other language bindings are already doing, ie. get the language plugin to return a newly allocated buffer, check it is long enough, copy out the data. The server patch implements a
2017 Sep 22
0
[PATCH v3 02/22] common/mlpcre: Add PCRE.subi to return indexes instead of the substring.
...+ + If there was no nth substring then this raises [Not_found]. *) diff --git a/common/mlpcre/pcre-c.c b/common/mlpcre/pcre-c.c index da9b50d34..15775dad0 100644 --- a/common/mlpcre/pcre-c.c +++ b/common/mlpcre/pcre-c.c @@ -225,3 +225,30 @@ guestfs_int_pcre_sub (value nv) memcpy (String_val (strv), str, len); CAMLreturn (strv); } + +value +guestfs_int_pcre_subi (value nv) +{ + CAMLparam1 (nv); + int n = Int_val (nv); + CAMLlocal1 (rv); + struct last_match *m = gl_tls_get (last_match); + + if (m == NULL) + raise_pcre_error ("PCRE.subi called without calling PCRE.matches&quot...
2017 Jun 15
0
[PATCH v6 10/41] mllib, v2v: Split out OCaml utils bindings ‘common/mlutils’.
...agma GCC diagnostic ignored "-Wmissing-prototypes" value -v2v_utils_drive_name (value indexv) +guestfs_int_mlutils_drive_name (value indexv) { CAMLparam1 (indexv); CAMLlocal1 (namev); @@ -54,7 +54,7 @@ v2v_utils_drive_name (value indexv) } value -v2v_utils_drive_index (value strv) +guestfs_int_mlutils_drive_index (value strv) { CAMLparam1 (strv); ssize_t r; @@ -67,7 +67,7 @@ v2v_utils_drive_index (value strv) } value -v2v_utils_shell_unquote (value strv) +guestfs_int_mlutils_shell_unquote (value strv) { CAMLparam1 (strv); CAMLlocal1 (retv); diff --git a/co...
2009 Dec 09
4
binary string conversion to a vector (PR#14120)
Full_Name: Franc Brglez Version: R 2.9.1 GUI 1.28 Tiger build 32-bit (5444) OS: MacOSX -- 10.6.2 Submission from: (NULL) (24.148.163.114) I am demonstrating what may be a bug or my lack of experience. Please review as it would help to hear from someone. MANY THANKS -- Franc Brglez The function "binS2binV" returns what I consider a wrong value -- see the terminal output binS2binV =