← Commit list

b141b9b51

Denis Vlasenko
Denis Vlasenko
2006-10-31
FAILED Duration: 4s

Subject

reads: fix bug 1078

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/read.c+2 -1
@@ -86,7 +86,8 @@ char *reads(int fd, char *buffer, size_t size)
if (p) {
off_t offset;
*p++ = '\0';
- offset = (p-buffer) - size;
+ // avoid incorrect (unsigned) widening
+ offset = (off_t)(p-buffer) - (off_t)size;
// set fd position the right after the \n
if (offset && lseek(fd, offset, SEEK_CUR) == (off_t)-1)
return NULL;