This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug stdio/24583] New: Memory leak in fopen with ccs argument


https://sourceware.org/bugzilla/show_bug.cgi?id=24583

            Bug ID: 24583
           Summary: Memory leak in fopen with ccs argument
           Product: glibc
           Version: 2.30
            Status: NEW
          Severity: minor
          Priority: P2
         Component: stdio
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
  Target Milestone: ---
             Flags: security-

Reproducer:

#include <err.h>
#include <locale.h>
#include <stdio.h>

int
main (void)
{
  if (setlocale (LC_ALL, "fr_FR.iso885915@euro") == NULL)
    err (1, "setlocale");
  FILE *fp = fopen ("/etc/passwd", "r,ccs=UTF-8");
  if (fp == NULL)
    err (1, "fopen");
  if (fclose (fp) != 0)
    err (1, "fclose");
  return 0;
}

The problem seems to be that the libio code never calls __gconv_close_transform
for the gconv functions returned by __wcsmbs_named_conv.  Calling
__gconv_release_step in _IO_new_fclose is not sufficient.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]