popt/fix-obscure-iconv-mis-call-error-path-could-lead-to-.patch

27 lines
645 B
Diff
Raw Normal View History

2019-12-31 23:06:09 +08:00
From 9c977f94d59f55d86e6f0cfbc3cd9401861b75b0 Mon Sep 17 00:00:00 2001
From: jbj <jbj>
Date: Mon, 9 Aug 2010 17:31:45 +0000
Subject: [PATCH 051/157] - fix: obscure iconv mis-call error path could lead
to strdup(NULL) (coverity).
---
2020-07-25 17:32:52 +08:00
src/poptint.c | 2 +-
2019-12-31 23:06:09 +08:00
1 file changed, 1 insertion(+), 1 deletion(-)
2020-07-25 17:32:52 +08:00
diff --git a/src/poptint.c b/src/poptint.c
2019-12-31 23:06:09 +08:00
index 5e09fa4..67f0051 100644
2020-07-25 17:32:52 +08:00
--- a/src/poptint.c
+++ b/src/poptint.c
2019-12-31 23:06:09 +08:00
@@ -145,7 +145,7 @@ assert(dstr); /* XXX can't happen */
}
(void) iconv_close(cd);
*pout = '\0';
- ostr = xstrdup(dstr);
+ ostr = xstrdup(dstr ? dstr : istr);
free(dstr);
} else
ostr = xstrdup(istr);
--
2.19.1