summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/util/utilmod.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/nss/lib/util/utilmod.c')
-rw-r--r--security/nss/lib/util/utilmod.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/security/nss/lib/util/utilmod.c b/security/nss/lib/util/utilmod.c
index 7d3fcda81..3ed7b3dd6 100644
--- a/security/nss/lib/util/utilmod.c
+++ b/security/nss/lib/util/utilmod.c
@@ -413,7 +413,10 @@ nssutil_ReadSecmodDB(const char *appName,
/* remove the ending newline */
len = PORT_Strlen(line);
- if (len && line[len - 1] == '\n') {
+ if (len >= 2 && line[len - 2] == '\r' && line[len - 1] == '\n') {
+ len = len - 2;
+ line[len] = 0;
+ } else if (len && (line[len - 1] == '\n' || line[len - 1] == '\r')) {
len--;
line[len] = 0;
}