search for: xcalloc

Displaying 20 results from an estimated 47 matches for "xcalloc".

Did you mean: calloc
2006 May 04
2
xmalloc(foo*bar) -> xcalloc(foo, bar) for Portable
...hat there's a few Portable-specific escapees from the xmalloc(foo * bar) cleanup. There's also a "probably can't happen" integer overflow in ssh-rand-helper.c with the memset: num_cmds = 64; - entcmd = xmalloc(num_cmds * sizeof(entropy_cmd_t)); + entcmd = xcalloc(num_cmds, sizeof(entropy_cmd_t)); memset(entcmd, '\0', num_cmds * sizeof(entropy_cmd_t)); Unless sizeof(entropy_cmd_t) is *really* big, it ought to safe :-) Index: auth-pam.c =================================================================== RCS file: /usr/local/src/security/ope...
2010 May 13
1
xf86-video-nouveau-git and xorg-server-git
Hi! With current git version of xorg-server when I try to compile xf86-video-nouveau I got these errors: nouveau_exa.lo nouveau_exa.c: In function 'nouveau_exa_create_pixmap': nouveau_exa.c:325:3: warning: 'Xcalloc' is deprecated (declared at /usr/include/xorg/os.h:225) nouveau_exa.c:331:2: warning: 'Xcalloc' is deprecated (declared at /usr/include/xorg/os.h:225) nouveau_exa.c:372:3: warning: 'Xfree' is deprecated (declared at /usr/include/xorg/os.h:234) nouveau_exa.c: In function '...
2010 Jun 17
1
Small bug in mux_master_read_cb()
...ide it, but it would corrupt memory if the struct were to be extended. Simple fix here: diff --git a/mux.c b/mux.c index 3f5babc..f151021 100644 --- a/mux.c +++ b/mux.c @@ -931,7 +976,7 @@ mux_master_read_cb(Channel *c) /* Setup ctx and */ if (c->mux_ctx == NULL) { - state = xcalloc(1, sizeof(state)); + state = xcalloc(1, sizeof(*state)); c->mux_ctx = state; channel_register_cleanup(c->self, mux_master_control_cleanup_cb, 0); -- -- Howard Chu CTO, Symas Corp. http://www.symas.com Director, Highland Sun http:/...
2019 Feb 22
2
[PATCH 2/2] Cygwin: implement case-insensitive Unicode user and group name matching
On Feb 22 16:02, Darren Tucker wrote: > On Fri, Feb 22, 2019 at 03:32:43PM +1100, Darren Tucker wrote: > > On Wed, 20 Feb 2019 at 23:54, Corinna Vinschen <vinschen at redhat.com> wrote: > > > The previous revert enabled case-insensitive user names again. This > > > patch implements the case-insensitive user and group name matching. > > > To allow Unicode
2013 Aug 14
1
ssh.c - allocated wrong size for sensitive_data.keys?
...ssh.c:848 which uses size of Key instead of Key*. This is probably harmless but seems to be wrong. --- a/ssh.c +++ b/ssh.c @@ -846,7 +846,7 @@ main(int ac, char **av) options.hostbased_authentication) { sensitive_data.nkeys = 7; sensitive_data.keys = xcalloc(sensitive_data.nkeys, - sizeof(Key)); + sizeof(Key *)); for (i = 0; i < sensitive_data.nkeys; i++) sensitive_data.keys[i] = NULL; Petr
2019 Mar 12
2
[PATCH 2/2] Cygwin: implement case-insensitive Unicode user and group name matching
...the cygwin > > function is always called for case-insensitive operation. > > > > How's this? It's just tweaking your patch a bit, simplifying the Cygwin > > code. > > Looks good, I've committed it. Thanks! > One final tweak: replace alloca with > xcalloc since it checks for integer overflow, will fail instead of blowing > the stack on large allocs and is likely at a less well-known location. > Also include stdlib.h for the prototype for free(). > > diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c > in...
2015 Jun 02
3
OpenSSH Linux portable patch proposal
Dear OpenSSH Developers, I would like to propose a patch to OpenSSH for Linux. In the recent few months, I have encountered a scenario where a PAM module used for authentication in SSH should be informed about the previous successful authentication methods. I described the complete scenario here:
2014 Jun 23
2
ListenAdress Exclusion
I was wondering what everyone's thoughts were on a simpler way to exclude addresses from having listeners on them. I know a lot of people have multiple subnets, especially larger corporations. Some networks are non-route-able, and therefor unsuitable for use with SSH, aside from communication between other servers on the same subnet. Given that we may want to exclude those non-route-able
2012 Nov 21
1
HostKey in hardware?
Hi, Is there any way to store HostKey in hardware (and delegate the related processing)? I have been using Roumen Petrov's x509 patch for clients, which works via an OpenSSL engine, but it does not seem to support server HostKey: http://roumenpetrov.info/pipermail/ssh_x509_roumenpetrov.info/2012q4/000019.html For PKCS#11, I have found an email on this list from a year back suggesting this
2011 Feb 07
1
[PATCH] ssh: set proctitle for mux master
...2 are open or directed to /dev/null */ - sanitise_stdfd(); - __progname = ssh_get_progname(av[0]); init_rng(); +#ifndef HAVE_SETPROCTITLE + /* Prepare for later setproctitle emulation */ + { + /* Save argv. Duplicate so setproctitle emulation doesn't clobber it */ + char **saved_argv = xcalloc(ac + 1, sizeof(*saved_argv)); + for (i = 0; i < ac; i++) + saved_argv[i] = xstrdup(av[i]); + saved_argv[i] = NULL; + compat_init_setproctitle(ac, av); + av = saved_argv; + } +#endif + + /* Ensure that fds 0, 1 and 2 are open or directed to /dev/null */ + sanitise_stdfd(); + /* * Disca...
2014 Jun 16
1
[PATCH 1/1] rework printing for visual host key upper border
...with itself. Matter of taste. */ char *augmentation_string = " .o+=*BOX@%&#/^SE"; - char *retval, *p; + char *retval, *p, key_details[FLDSIZE_X + 1]; u_char field[FLDSIZE_X][FLDSIZE_Y]; u_int i, b; int x, y; size_t len = strlen(augmentation_string) - 1; retval = xcalloc(1, (FLDSIZE_X + 3) * (FLDSIZE_Y + 2)); + p = retval; /* initialize field */ memset(field, 0, FLDSIZE_X * FLDSIZE_Y * sizeof(char)); @@ -587,11 +588,14 @@ key_fingerprint_randomart(u_char *dgst_raw, u_int dgst_raw_len, const Key *k) field[FLDSIZE_X / 2][FLDSIZE_Y / 2] = len - 1; field[x][y...
2015 Jul 26
2
[PATCH] ssh-agent: Add support to load additional certificates
...ntity) next; - struct sshkey *key; + RefcountKey *idkey; + RefcountKey *shadowed_key; char *comment; char *provider; time_t death; @@ -188,16 +194,43 @@ idtab_lookup(int version) return &idtable[version]; } +static RefcountKey * +refkey_new(struct sshkey *key) +{ + RefcountKey *ref = xcalloc(1, sizeof(RefcountKey)); + + ref->key = key; + ref->count = 1; + + return ref; +} + +static RefcountKey * +refkey_addref(RefcountKey *refkey) +{ + ++refkey->count; + return refkey; +} + +static void refkey_unref(RefcountKey *refkey) +{ + if (refkey && --refkey->count <= 0) {...
2012 Jan 28
1
PATCH: Support for encrypted host keys
...g3("%s: entering fd = %d", __func__, fd); @@ -981,6 +999,30 @@ recv_rexec_state(int fd, Buffer *conf) rexec_recv_rng_seed(&m); #endif + num_host_keys = buffer_get_int(&m); + debug("%s: receiving %d host keys", __func__, num_host_keys); + sensitive_data.host_keys = xcalloc(num_host_keys, sizeof(Key *)); + + num_rexec_recvd_host_keys = num_host_keys; + + for (i = 0; i < num_host_keys; i++) { + hk = buffer_get_key(&m); + debug("%s: received %s host key", __func__, key_type(hk)); + sensitive_data.host_keys[i] = hk; + switch (hk->type) { + case K...
2012 Nov 24
0
ssh-keyscan continuity patch --
...as been received, and returns its type. Note that * no other data is processed until this returns, so this function should not * be used during the interactive session. @@ -1033,6 +1044,9 @@ DBG(debug("packet_read()")); + connclosed = 0; + conntimedout = 0; + setp = (fd_set *)xcalloc(howmany(active_state->connection_in + 1, NFDBITS), sizeof(fd_mask)); @@ -1087,6 +1101,7 @@ } } if (ret == 0) { + conntimedout = 1; logit("Connection to %.200s timed out while " "waiting to read", get_remote_ipaddr()); cleanup_exit(255); @@...
2009 Aug 12
4
TV-out modesetting DDX patches
[PATCH 1/3] kms: Don't hardcode the output properties [PATCH 2/3] kms: Implement output->get_property when RandR1.3 is available. [PATCH 3/3] kms: Add TV-out support src/drmmode_display.c | 403 ++++++++++++++++++++++++++++++++----------------- 1 files changed, 261 insertions(+), 142 deletions(-)
2011 Jun 23
1
sandbox for OS X
...+ pid_t child_pid; +}; + +struct ssh_sandbox * +ssh_sandbox_init(void) +{ + struct ssh_sandbox *box; + + /* + * Strictly, we don't need to maintain any state here but we need + * to return non-NULL to satisfy the API. + */ + debug3("%s: preparing Darwin sandbox", __func__); + box = xcalloc(1, sizeof(*box)); + box->child_pid = 0; + + return box; +} + +void +ssh_sandbox_child(struct ssh_sandbox *box) +{ + char *errmsg; + + debug3("%s: starting Darwin sandbox", __func__); + if (sandbox_init(kSBXProfilePureComputation, SANDBOX_NAMED, + &errmsg) == -1) + fatal("...
2010 Nov 09
0
[ANNOUNCE] xf86-video-geode 2.11.10
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Andres Salomon (1): fix the DCON verification loop for LX output Daniel Drake (2): Add get_crtc output function Don't power down DCON when it is frozen Frank Huang (4): Replace xalloc/xrealloc/xfree/xcalloc with malloc/realloc/free/calloc Mode Validation support on modeline in xorg.conf Fix a typo on resolution parameter Add resolution 1024x600 support for PANEL Huang, FrankR (2): Revise the entry for 1024x600 Simplify the mode_valid function Hunk (1): Modify rota...
2014 Jun 04
0
[patch] Tiny patch to change 'no slots' to debug in PKCS#11 situations
...penssh-6.6p1.orig/ssh-pkcs11.c 2014-06-04 10:19:09.000000000 +0200 +++ openssh-6.6p1/ssh-pkcs11.c 2014-06-04 10:20:29.000000000 +0200 @@ -602,7 +602,7 @@ goto fail; } if (p->nslots == 0) { - error("no slots"); + debug("no slots"); goto fail; } p->slotlist = xcalloc(p->nslots, sizeof(CK_SLOT_ID));
2016 Oct 04
0
[ANNOUNCE] libX11 1.6.4
Alan Coopersmith (20): Move Compose \ o / to be with other emoji compose sequences Replace Xmalloc+memset pairs with Xcalloc calls Get rid of some extraneous ; at the end of C source lines Remove unused definition of XCONN_CHECK_FREQ Bug 93184: read_EncodingInfo invalid free Bug 93183: _XDefaultOpenIM memory leaks in out-of-memory error paths Delete #if 0 hunks of code Use strdup inste...
2011 Jun 22
3
sandbox pre-auth privsep child
..."xmalloc.h" + +/* dummy sandbox */ + +struct ssh_sandbox { + int junk; +}; + +struct ssh_sandbox * +ssh_sandbox_init(void) +{ + struct ssh_sandbox *box; + + /* + * Strictly, we don't need to maintain any state here but we need + * to return non-NULL to satisfy the API. + */ + box = xcalloc(1, sizeof(*box)); + return box; +} + +void +ssh_sandbox_child(struct ssh_sandbox *box) +{ + /* Nothing to do here */ +} + +void +ssh_sandbox_parent_finish(struct ssh_sandbox *box) +{ + free(box); +} + +void +ssh_sandbox_parent_preauth(struct ssh_sandbox *box, pid_t child_pid) +{ + /* Nothing to do...