diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-03 09:23:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-03 20:44:53 +0000 |
commit | 2cfc6259971f53af45e57de1117f6a1f345a7b23 (patch) | |
tree | e7807f85822130891fbf9f03a6c66870adcbe147 /hwpfilter | |
parent | 7db11e4a168e57c9f91dc2c5078adc7179e6fab8 (diff) |
coverity#1209713 Dereference null return value
Change-Id: I8aba67ae5bf5ffb7530be8f6d5b2511b554717db
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hcode.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx index 93f5f0ff72ca..42b7205824b2 100644 --- a/hwpfilter/source/hcode.cxx +++ b/hwpfilter/source/hcode.cxx @@ -1309,8 +1309,12 @@ char *hcolor2str(uchar color, uchar shade, char *buf, bool bIsChar) if( src[0] == 'C' && src[1] == ':' && src[2] == '\\' ) // Home Dir { ret.append("file://"); - ret.append(getenv("HOME")); - ret.push_back('/'); + const char *pHome = getenv("HOME"); + if (pHome) + { + ret.append(pHome); + ret.push_back('/'); + } i = 3; // skip first 3 } else if( src[0] == 'D' && src[1] == ':' && src[2] == '\\' ) // Root Dir |