Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 13 Aug 2012 12:04:14 +0200
From: "Arvid E. Picciani" <aep@...s.org>
To: <musl@...ts.openwall.com>
Subject: getpwent.c:  isn't line supposed to be set NULL?

the getpw* functions call getline in a dubious way
for example:

struct passwd *__getpwent_a(FILE *f, struct passwd *pw, char **line, 
size_t *size)
[..]
		if ((l=getline(line, size, f)) < 0) {
			free(*line);
			*line = 0;


is called from

struct passwd *fgetpwent(FILE *f)
[..]
	static char *line;
	return __getpwent_a(f, &pw, &line, &size);


where line is uninitialized.

first thing getdelim (forwarded from getline) does is:

if (!*s) *n=0;

so this looks wrong somewhere.
maybe i'm just missing an =0 in between.


-- 
Arvid E. Picciani

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.