summaryrefslogtreecommitdiffstats
path: root/cui
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-07-04 20:06:16 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-07-04 20:11:47 +0200
commit6151c6f4508fad5f37142d6c6c3286191ecd580c (patch)
treefad6c985c9cb24be99c04d5f2f2581cdaca5f7d8 /cui
parentcoverity#735602-3 Division by zero (diff)
downloadcore-6151c6f4508fad5f37142d6c6c3286191ecd580c.tar.gz
core-6151c6f4508fad5f37142d6c6c3286191ecd580c.zip
coverity#735300-1 Unchecked return value
Change-Id: I9cb69643ba43adc76ef38db61da2b7c1c3d3e3c1
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/optinet2.cxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 9fad8b6b802b..00dbf792ae57 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -1030,18 +1030,28 @@ bool MozPluginTabPage::installPlugin()
#ifdef UNIX
// get the real file referred by .so lnk file
char* pHome = getpwuid(getuid())->pw_dir;
+ if(!pHome)
+ {
+ return false;
+ }
OString lnkFilePath(OString(pHome) + OString("/.mozilla/plugins/libnpsoplugin" SAL_DLLEXTENSION));
- remove(lnkFilePath.getStr());
+ (void)remove(lnkFilePath.getStr());
// create the dirs if necessary
struct stat buf;
char tmpDir[NPP_PATH_MAX] = {0};
- sprintf(tmpDir, "%s/.mozilla", pHome);
+ snprintf(tmpDir, NPP_PATH_MAX, "%s/.mozilla", pHome);
if (0 > stat(lnkFilePath.getStr(), &buf))
{
- mkdir(tmpDir, 0755);
+ if(mkdir(tmpDir, 0755))
+ {
+ return false;
+ }
strcat(tmpDir, "/plugins");
- mkdir(tmpDir, 0755);
+ if(mkdir(tmpDir, 0755))
+ {
+ return false;
+ }
}
// get the real file path