iconv: Fix possible null-pointer dereference.
Checks
Context |
Check |
Description |
dj/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
Commit Message
The dereference can appear at iconv.c:54.
This problem was found by SVACE static analyzer.
---
iconv/iconv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mär 31 2022, Dmitry Chestnyh wrote:
> The dereference can appear at iconv.c:54.
When inbuf isn't NULL then outbuf cannot be NULL.
@@ -35,7 +35,7 @@ iconv (iconv_t cd, char **inbuf, size_t *inbytesleft, char **outbuf,
size_t irreversible;
int result;
- if (__glibc_unlikely (inbuf == NULL || *inbuf == NULL))
+ if (__glibc_unlikely (inbuf == NULL || *inbuf == NULL || outbuf == NULL))
{
if (outbuf == NULL || *outbuf == NULL)
result = __gconv (gcd, NULL, NULL, NULL, NULL, &irreversible);