search for: slen

Displaying 20 results from an estimated 133 matches for "slen".

Did you mean: len
2011 Feb 26
3
hivex: some issues (key encoding, ...) and suggested fixes
...contain a genuine UTF-16 string. * * In this case, iconv would try to process the junk bytes as UTF-16 * and inevitably find an illegal sequence (EILSEQ). Instead, stop * after we find the first \0\0. * * (Found by Hilko Bengen in a fresh Windows XP SOFTWARE hive). */ size_t slen = utf16_string_len_in_bytes_max (data, len); if (slen > len) len = slen; char *ret = windows_utf16_to_utf8 (data, len); slen is only used to increase length of data, but I think it should be decreasing it (to stop earlier). Example key where problem occurs: software\Microsoft\MediaPla...
2000 Feb 08
1
problem with va_list type (alpha) (PR#421)
...e. (and R runs now, but I guess only because I didn't came across this code section) --- ./src/main/printutils.c.va_list.patch Mon Feb 7 15:08:14 2000 +++ ./src/main/printutils.c Mon Feb 7 15:52:54 2000 @@ -421,7 +421,7 @@ else { char buf[BUFSIZE], *p = buf, *vmax = vmaxget(); int slen, res; - if(!arg) { + if(&arg!=NULL) { /* just a string, so length is known */ if((slen = strlen(format)) >= BUFSIZE) p = R_alloc(slen+1, sizeof(char)); -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://...
2018 Dec 15
0
[PATCH nbdkit v2 3/4] sh: Switch nbdkit-sh-plugin to use API version 2.
...BDKIT_FLAG_FUA) + flag_append ("fua", &comma, &buf, &len); + + if (flags & NBDKIT_FLAG_MAY_TRIM) + flag_append ("may_trim", &comma, &buf, &len); +} + +static void +flag_append (const char *str, bool *comma, char **buf, size_t *len) +{ + size_t slen = strlen (str); + + if (*comma) { + /* Too short flags buffer is an internal error so abort. */ + if (*len <= 1) abort (); + strcpy (*buf, ","); + (*buf)++; + (*len)--; + } + + if (*len <= slen) abort (); + strcpy (*buf, str); + (*buf) += slen; + (*len) -= slen;...
2011 Mar 18
1
[Patch suggestion] Adding 3rd arg to tempfile() to set extension
...n/sysutils.c (working copy) @@ -233,30 +233,44 @@ SEXP attribute_hidden do_tempfile(SEXP call, SEXP op, SEXP args, SEXP env) { - SEXP ans, pattern, tempdir; - const char *tn, *td; + SEXP ans, pattern, fileext, tempdir; + const char *tn, *td, *te; char *tm; - int i, n1, n2, slen; + int i, n1, n2, n3, slen; + char tmp1[PATH_MAX]; checkArity(op, args); - pattern = CAR(args); n1 = length(pattern); - tempdir = CADR(args); n2 = length(tempdir); + pattern = CAR(args); n1 = length(pattern); args = CDR(args); + tempdir = CAR(args); n2 = length(tempdir); ar...
2018 Dec 15
1
Re: [PATCH nbdkit v2 3/4] sh: Switch nbdkit-sh-plugin to use API version 2.
...3)>. Presumably we don't care if the user includes or omits a trailing newline on their output? > +static int > +sh_can_fua (void *handle) > +{ > + char *h = handle; > + const char *args[] = { script, "can_fua", h, NULL }; > + char *s = NULL; > + size_t slen; > + int r; > + > + switch (call_read (&s, &slen, args)) { > + case OK: > + if (slen > 0 && s[slen-1] == '\n') > + s[slen-1] = '\0'; Good - you do ignore trailing newline. Makes it easier for the author to not worry about it either w...
2013 Jun 25
1
RFC: encrypted hostkeys patch
...private == NULL) - fatal("Missing private key for hostkey type %d", - kex->hostkey_type); /* key, cert */ if ((dh_client_pub = BN_new()) == NULL) @@ -144,9 +141,8 @@ kexdh_server(Kex *kex) } /* sign H */ - if (PRIVSEP(key_sign(server_host_private, &signature, &slen, hash, - hashlen)) < 0) - fatal("kexdh_server: key_sign failed"); + kex->sign(server_host_private, server_host_public, &signature, &slen, + hash, hashlen); /* destroy_sensitive_data(); */ diff --git a/kexecdhs.c b/kexecdhs.c index c42dcf4..eec5fb6 100644 --- a...
2018 Dec 15
5
[PATCH nbdkit v2 0/4] tests: Test export flags (eflags).
v1 was here: https://www.redhat.com/archives/libguestfs/2018-December/thread.html#00123 v2: - Document "-" instead of "script=-" and use it in the test; and verify this also works on FreeBSD; and verify that it doesn't depend on the particular behaviour of our wrapper script and should work with installed nbdkit too. - Fix handling of zero flags parameter. -
2003 Nov 14
2
writeChar potential buffer overrun (PR#5090)
Trying to copy the (binary) header of a input file directly to an output file, I've had repeatable seg faults. The call: writeChar(hdr, outfh, nchars=6144) when hdr just contains one empty string seems to be the culprit. The stack traces weren't all that illuminating, with sig 11 in memory-related functions following this. But in src/main/connections.c it looks like do_writechar
2007 Sep 07
1
"bug" and patch: quadratic running time for strsplit(..., fixed=TRUE) (PR#9902)
...ATCHES (against trunk) Only the first is required to fix strsplit(). Index: src/main/character.c =================================================================== --- src/main/character.c (revision 42792) +++ src/main/character.c (working copy) @@ -357,7 +357,7 @@ int i, j, len, tlen, ntok, slen; int extended_opt, cflags, fixed_opt, perl_opt; char *pt = NULL; - const char *buf, *split = "", *bufp, *laststart; + const char *buf, *split = "", *bufp, *laststart, *ebuf = NULL; regex_t reg; regmatch_t regmatch[1]; pcre *re_pcre = NULL; @@ -419,...
2003 Oct 08
4
OS/390 openssh
...h2-hostbased.c Tue Oct 7 08:21:59 2003 @@ -60,10 +60,10 @@ return 0; } pkalg = packet_get_string(&alen); - pkblob = packet_get_string(&blen); + pkblob = packet_get_binary(&blen); chost = packet_get_string(NULL); cuser = packet_get_string(NULL); - sig = packet_get_string(&slen); + sig = packet_get_binary(&slen); debug("userauth_hostbased: cuser %s chost %s pkalg %s slen %d", cuser, chost, pkalg, slen); @@ -101,7 +101,7 @@ buffer_put_cstring(&b, service); buffer_put_cstring(&b, "hostbased"); buffer_put_string(&b, pkalg,...
2019 May 16
0
[nbdkit PATCH v2 07/24] sh: Implement .cache script callback
...conn"); } +/* Not a boolean method, the method prints "none", "emulate" or "native". */ +static int +sh_can_cache (void *handle) +{ + char *h = handle; + const char *args[] = { script, "can_cache", h, NULL }; + CLEANUP_FREE char *s = NULL; + size_t slen; + int r; + + switch (call_read (&s, &slen, args)) { + case OK: + if (slen > 0 && s[slen-1] == '\n') + s[slen-1] = '\0'; + if (strcasecmp (s, "none") == 0) + r = NBDKIT_CACHE_NONE; + else if (strcasecmp (s, "emulate") == 0...
2023 Apr 27
1
[RFC PATCH v2 1/3] PCI: endpoint: introduce a helper to implement pci ep virtio function
...ome of the function descriptions end with a period (".") and others don't. Please figure out what the most common style is and use that consistently. > + dst = pci_epc_map_addr(epf->epc, epf->func_no, > + epf->vfunc_no, dbase, &phys, > + slen); > + if (IS_ERR(dst)) { > + pr_err("failed to map pci mmoery spact to local\n"); s/pci/PCI/ s/mmoery/memory/ s/spact/space/ ? Also below. IIRC some previous messages started with a capital letter. Please make them all consistent. > + if (dir == DMA_MEM_TO_DEV) { >...
2006 Jul 05
2
Procmail patch for dovecot delivery
...e = boxname[0] == '/'; + int isinbox = 0; + if (s_org_mail) isinbox = !strcmp(s_org_mail, boxname); + + if (trydeliver && program && ((!isinbox && !isabsolute) || (isinbox && deliver_inbox) || (isabsolute && deliver_absolute_path)) ) + { + char slen[16]; + int oldrawnonl; + int retval; + size_t str_len; + char* tmp; + + int deliver_raw_mode = isyes("DELIVER_RAW_MODE"); + int deliver_remove_from = isyes("DELIVER_REMOVE_FROM"); + int deliver_replace_inbox_name = isyes("DELIVER_REPLACE_INBOX_NAME&quot...
2020 Aug 25
0
[nbdkit PATCH 5/5] sh, eval: Implement .default_export
...;INTERLEAVED\n")) != NULL) { n = p; while ((d = strchr (n, '\n')) != NULL) { @@ -310,13 +312,18 @@ sh_list_exports (int readonly, int default_only, default_only ? "true" : "false", NULL }; CLEANUP_FREE char *s = NULL; size_t slen; + const char *def; switch (call_read (&s, &slen, args)) { case OK: return parse_exports (script, s, slen, exports); case MISSING: - return nbdkit_add_export (exports, "", NULL); + /* Match what is done for a C plugin. */ + def = sh_default_export (readon...
2007 Apr 12
2
[PATCH] Make com32 printf obey width-restriction on %s
...-- syslinux-3.36/com32/lib/vsnprintf.c.orig 2007-02-10 21:47:08.000000000 +0100 +++ syslinux-3.36/com32/lib/vsnprintf.c 2007-04-12 12:08:54.000000000 +0200 @@ -362,7 +362,7 @@ case 's': /* String */ sarg = va_arg(ap, const char *); sarg = sarg ? sarg : "(null)"; - slen = strlen(sarg); + slen = width ? strnlen(sarg, width) : strlen(sarg); goto is_string; is_string: --- syslinux-3.36/com32/lib/strnlen.c.orig 2007-04-12 12:07:18.000000000 +0200 +++ syslinux-3.36/com32/lib/strnlen.c 2007-04-12 12:05:41.000000000 +0200 @@ -0,0 +1,14 @@ +/* + * strnlen.c +...
2013 Sep 24
9
[PATCH] curve25519-sha256@libssh.org key exchange proposal
...et; + Key *server_host_key; + u_char client_key[CURVE25519_PRIVKEY_SIZE]; + u_char client_pubkey[CURVE25519_PUBKEY_SIZE]; + u_char *server_pubkey = NULL; + u_char shared_secret_raw[CURVE25519_PUBKEY_SIZE]; + u_char *server_host_key_blob = NULL, *signature = NULL; + u_char *hash; + u_int rnd = 0, slen, sbloblen, hashlen, i; + + /* generate private key */ + for (i = 0; i < sizeof(client_key); i++) { + if (i % 4 == 0) + rnd = arc4random(); + client_key[i] = rnd; + rnd >>= 8; + } + crypto_scalarmult_curve25519_base(client_pubkey, client_key); + + packet_start(SSH2_MSG_KEX_ECDH...
2020 May 19
1
[PATCH nbdkit] common/include: Add locale-safe ascii_strcasecmp and ascii_strncasecmp.
...plugins/sh/methods.c +++ b/plugins/sh/methods.c @@ -45,6 +45,7 @@ #include <nbdkit-plugin.h> #include "cleanup.h" +#include "ascii-string.h" #include "call.h" #include "methods.h" @@ -105,16 +106,16 @@ sh_thread_model (void) case OK: if (slen > 0 && s[slen-1] == '\n') s[slen-1] = '\0'; - if (strcasecmp (s, "parallel") == 0) + if (ascii_strcasecmp (s, "parallel") == 0) r = NBDKIT_THREAD_MODEL_PARALLEL; - else if (strcasecmp (s, "serialize_requests") == 0 || -...
2016 Mar 17
0
[PATCH 1/3] appliance: Pass "quiet" option to kernel when !verbose.
...") ? " guestfs_identifier=" : "", diff --git a/src/proto.c b/src/proto.c index 5213856..df7be89 100644 --- a/src/proto.c +++ b/src/proto.c @@ -129,6 +129,9 @@ guestfs_int_log_message_callback (guestfs_h *g, const char *buf, size_t len) const char *sentinel; size_t slen; + /* Since 2016-03, if !verbose, then we add the "quiet" flag to the + * kernel, so the following sentinel will never be produced. XXX + */ sentinel = "Linux version"; /* kernel up */ slen = strlen (sentinel); if (memmem (buf, len, sentinel, slen) !=...
2018 Dec 14
0
[PATCH nbdkit 2/3] sh: Switch nbdkit-sh-plugin to use API version 2.
...(handle, "can_trim"); +} + +static int +sh_can_zero (void *handle) +{ + return boolean_method (handle, "can_zero"); +} + +static int +sh_can_fua (void *handle) +{ + char *h = handle; + const char *args[] = { script, "can_fua", h, NULL }; + char *s = NULL; + size_t slen; + int r; + + switch (call_read (&s, &slen, args)) { + case OK: + if (slen > 0 && s[slen-1] == '\n') + s[slen-1] = '\0'; + if (strcmp (s, "none") == 0) + r = NBDKIT_FUA_NONE; + else if (strcmp (s, "emulate") == 0) + r...
2011 Dec 04
0
[GIT PULL] klibc minor fixes
...me, int len) /* * Clear the set of configuration strings. */ -void clear_config(void) +static void clear_config(void) { len_config = 0; define_config("", 0); @@ -196,7 +195,7 @@ void clear_config(void) /* * Record the use of a CONFIG_* word. */ -void use_config(char *m, int slen) +static void use_config(char *m, int slen) { char s[PATH_MAX]; char *p; @@ -217,7 +216,7 @@ void use_config(char *m, int slen) printf(" $(wildcard include/config/%s.h) \\\n", s); } -void parse_config_file(char *map, size_t len) +static void parse_config_file(char *map, size_...