[maemo-commits] [maemo-commits] r18659 - in projects/haf/trunk/ke-recv: debian src
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Mon Jun 8 15:53:32 EEST 2009
- Previous message: [maemo-commits] r18658 - in projects/haf/trunk/ke-recv-extra: debian src
- Next message: [maemo-commits] r18660 - in projects/haf/trunk/hildon-thumbnail: . daemon/plugins thumbs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: kihamala
Date: 2009-06-08 15:53:29 +0300 (Mon, 08 Jun 2009)
New Revision: 18659
Modified:
projects/haf/trunk/ke-recv/debian/changelog
projects/haf/trunk/ke-recv/src/events.c
projects/haf/trunk/ke-recv/src/ke-recv.c
projects/haf/trunk/ke-recv/src/mmc-check.c
projects/haf/trunk/ke-recv/src/mmc-format.c
projects/haf/trunk/ke-recv/src/swap_mgr.c
Log:
fix some coverity findings
Modified: projects/haf/trunk/ke-recv/debian/changelog
===================================================================
--- projects/haf/trunk/ke-recv/debian/changelog 2009-06-08 12:27:30 UTC (rev 18658)
+++ projects/haf/trunk/ke-recv/debian/changelog 2009-06-08 12:53:29 UTC (rev 18659)
@@ -3,6 +3,7 @@
* Fixes: NB#119586 - Unsafe signal handler in ke-recv
* Not showing the "mounted as read-only" infonote since it is now shown by
hulda.
+ * Fix a number of Coverity findings.
-- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com> Fri, 5 Jun 2009 13:33:23 +0300
Modified: projects/haf/trunk/ke-recv/src/events.c
===================================================================
--- projects/haf/trunk/ke-recv/src/events.c 2009-06-08 12:27:30 UTC (rev 18658)
+++ projects/haf/trunk/ke-recv/src/events.c 2009-06-08 12:53:29 UTC (rev 18659)
@@ -84,9 +84,9 @@
if (mmc->internal_card) {
strcpy(mmc->display_name, "internal card");
} else {
- strcpy(mmc->display_name,
- (const char*)dgettext("hildon-fm",
- "sfil_li_memorycard_removable"));
+ strncpy(mmc->display_name,
+ (const char*)dgettext("hildon-fm",
+ "sfil_li_memorycard_removable"), 100);
}
}
@@ -154,7 +154,7 @@
if (buf[0] == '\0' || buf[0] == ' ') {
set_localised_label(mmc);
} else {
- strcpy(mmc->display_name, (const char*)buf);
+ strncpy(mmc->display_name, (const char*)buf, 100);
}
}
g_free(buf);
@@ -373,6 +373,7 @@
return FALSE;
}
+#if 0
static void check_swap_dialog(mmc_info_t *mmc)
{
gboolean retval;
@@ -404,6 +405,7 @@
}
}
}
+#endif
static void possibly_turn_swap_off(swap_dialog_t dialog, mmc_info_t *mmc)
{
Modified: projects/haf/trunk/ke-recv/src/ke-recv.c
===================================================================
--- projects/haf/trunk/ke-recv/src/ke-recv.c 2009-06-08 12:27:30 UTC (rev 18658)
+++ projects/haf/trunk/ke-recv/src/ke-recv.c 2009-06-08 12:53:29 UTC (rev 18659)
@@ -2220,7 +2220,7 @@
remainder = invalid + 1;
}
- strcat(string, remainder);
+ strncat(string, remainder, 200);
return strdup(string);
}
Modified: projects/haf/trunk/ke-recv/src/mmc-check.c
===================================================================
--- projects/haf/trunk/ke-recv/src/mmc-check.c 2009-06-08 12:27:30 UTC (rev 18658)
+++ projects/haf/trunk/ke-recv/src/mmc-check.c 2009-06-08 12:53:29 UTC (rev 18659)
@@ -183,7 +183,7 @@
ULOG_DEBUG_L("entered");
if (argc != 2 && argc != 3) {
- ULOG_CRIT_L("Usage: %s <device> [-q]", argv[0]);
+ ULOG_CRIT_L("Usage: mmc-check <device> [-q]");
exit(1);
}
if (argc == 3) {
Modified: projects/haf/trunk/ke-recv/src/mmc-format.c
===================================================================
--- projects/haf/trunk/ke-recv/src/mmc-format.c 2009-06-08 12:27:30 UTC (rev 18658)
+++ projects/haf/trunk/ke-recv/src/mmc-format.c 2009-06-08 12:53:29 UTC (rev 18659)
@@ -264,8 +264,8 @@
ULOG_DEBUG_L("entered");
if (argc != 3 && argc != 4) {
- ULOG_CRIT_L("Usage: %s [<device>] <partition> <volume label>",
- argv[0]);
+ ULOG_CRIT_L("Usage: mmc-format [<device>] <partition>"
+ " <volume label>");
exit(1);
}
sa.sa_handler = sig_handler;
Modified: projects/haf/trunk/ke-recv/src/swap_mgr.c
===================================================================
--- projects/haf/trunk/ke-recv/src/swap_mgr.c 2009-06-08 12:27:30 UTC (rev 18658)
+++ projects/haf/trunk/ke-recv/src/swap_mgr.c 2009-06-08 12:53:29 UTC (rev 18659)
@@ -588,7 +588,7 @@
return EINVAL;
/* Open the file, O_ASYNC PROHIBITED because swap can be incorrectly created */
- file = open(path, O_CREAT|O_WRONLY|O_TRUNC);
+ file = open(path, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR | S_IWUSR);
if ( file < 0 )
return errno;
- Previous message: [maemo-commits] r18658 - in projects/haf/trunk/ke-recv-extra: debian src
- Next message: [maemo-commits] r18660 - in projects/haf/trunk/hildon-thumbnail: . daemon/plugins thumbs
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
