Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladimir Davydov <vdavydov.dev@gmail.com>
To: Olga Arkhangelskaia <arkholga@tarantool.org>
Cc: tarantool-patches@freelists.org
Subject: Re: [tarantool-patches] [PATCH v2 2/2] Added strdup fail checks in say
Date: Thu, 19 Jul 2018 15:26:16 +0300	[thread overview]
Message-ID: <20180719122615.yfo4jvionwdhyvum@esperanza> (raw)
In-Reply-To: <20180719105449.49710-2-arkholga@tarantool.org>

On Thu, Jul 19, 2018 at 01:54:49PM +0300, Olga Arkhangelskaia wrote:
> Strdup may silently fail without any message from tarantool.
> Patch adds this checks.
> ---
> Branch: https://github.com/tarantool/tarantool/tree/OKriw/refactor-log-cfg
> 
> v1:
> https://www.freelists.org/post/tarantool-patches/PATCH-22-Added-strdup-fail-checks-in-say
> 
> Changes in v2:
> - no double check now
> 
>  src/say.c | 5 +++++
>  1 file changed, 5 insertions(+)

This one looks good to me.

> 
> diff --git a/src/say.c b/src/say.c
> index 92e0e6d9f..99344b685 100644
> --- a/src/say.c
> +++ b/src/say.c
> @@ -502,6 +502,11 @@ log_syslog_init(struct log *log, const char *init_str)
>  		log->syslog_ident = strdup("tarantool");
>  	else
>  		log->syslog_ident = strdup(opts.identity);
> +	if (log->syslog_ident == NULL) {
> +		diag_set(OutOfMemory, strlen(opts.identity), "malloc",
> +		         "log->syslog_ident");
> +		return -1;
> +	}
>  
>  	if (opts.facility == syslog_facility_MAX)
>  		log->syslog_facility = SYSLOG_LOCAL7;

  reply	other threads:[~2018-07-19 12:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 10:54 [tarantool-patches] [PATCH v2 1/2] Refactoring in string validation of log parameters Olga Arkhangelskaia
2018-07-19 10:54 ` [tarantool-patches] [PATCH v2 2/2] Added strdup fail checks in say Olga Arkhangelskaia
2018-07-19 12:26   ` Vladimir Davydov [this message]
2018-07-19 13:12   ` Vladimir Davydov
2018-07-19 12:24 ` [tarantool-patches] [PATCH v2 1/2] Refactoring in string validation of log parameters Vladimir Davydov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180719122615.yfo4jvionwdhyvum@esperanza \
    --to=vdavydov.dev@gmail.com \
    --cc=arkholga@tarantool.org \
    --cc=tarantool-patches@freelists.org \
    --subject='Re: [tarantool-patches] [PATCH v2 2/2] Added strdup fail checks in say' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox