summaryrefslogtreecommitdiffstats
path: root/sal
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-06-12 09:57:18 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-06-12 10:24:19 +0100
commit2489589a64fbe0e892f3ccf5b86f7fec7dcd89db (patch)
treeb9867288dcd6419bfbb0a5330ac9efd880501abd /sal
parentset mnemonic widget and replace 24 with optimal height request (diff)
downloadcore-2489589a64fbe0e892f3ccf5b86f7fec7dcd89db.tar.gz
core-2489589a64fbe0e892f3ccf5b86f7fec7dcd89db.zip
coverity#982462 Dereference after null check
Change-Id: I5e90d51440afa4e317bc07ccb937f606edbc9eb9
Diffstat (limited to 'sal')
-rw-r--r--sal/osl/unx/pipe.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.c
index b1263c8d09f3..10ac93238413 100644
--- a/sal/osl/unx/pipe.c
+++ b/sal/osl/unx/pipe.c
@@ -147,20 +147,24 @@ cpyBootstrapSocketPath(sal_Char *name, size_t len)
if (rtl_bootstrap_get(pName, &pValue, NULL))
{
- rtl_String *pStrValue = 0;
if (pValue && pValue->length > 0)
{
+ rtl_String *pStrValue = 0;
+
rtl_uString2String(&pStrValue, pValue->buffer,
pValue->length, RTL_TEXTENCODING_UTF8,
OUSTRING_TO_OSTRING_CVTFLAGS);
- if (pStrValue && pStrValue->length > 0)
+ if (pStrValue)
{
- size_t nCopy = (len-1 < (size_t)pStrValue->length) ? len-1 : (size_t)pStrValue->length;
- strncpy (name, pStrValue->buffer, nCopy);
- name[nCopy] = '\0';
- bRet = (size_t)pStrValue->length < len;
+ if (pStrValue->length > 0)
+ {
+ size_t nCopy = (len-1 < (size_t)pStrValue->length) ? len-1 : (size_t)pStrValue->length;
+ strncpy (name, pStrValue->buffer, nCopy);
+ name[nCopy] = '\0';
+ bRet = (size_t)pStrValue->length < len;
+ }
+ rtl_string_release(pStrValue);
}
- rtl_string_release(pStrValue);
}
rtl_uString_release(pName);
}