Opened 6 years ago
Closed 6 years ago
#100 closed defect (fixed)
libc: getline implementation incorrectly checks the failure of realloc
| Reported by: | Lukáš Zaoral | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 4.4 |
| Component: | DiOS | Keywords: | |
| Cc: | kdudka@…, jamartis@…, lzaoral@… |
Description
Hello,
the following code results into a null pointer dereference in the implementation of getline when checked with divine verify.
#define _GNU_SOURCE
#include <stdio.h>
int main(void)
{
char* line = NULL;
size_t len = 0;
getline(&line, &len, stdin);
}
The enclosed patch fixes the issue. Thanks!
Attachments (1)
Change History (3)
Changed 6 years ago by
| Attachment: | getline.patch added |
|---|
comment:1 Changed 6 years ago by
comment:2 Changed 6 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Fixed in http://divine.fi.muni.cz/next.
Note: See
TracTickets for help on using
tickets.
Seem reasonable, I will look at the patch and integrate it.