Menu

#7 Potential overflow in watch4str

v1.0 (example)
closed
nobody
None
5
2023-01-01
2010-06-15
Anonymous
No

In watch4str the read(ifd, buf + largv, sizeof(buf) - largv); and then buf[cc + largv] = '\0'; could potentially put "\0" out of the buf overwriting then next variable when largv=0 and exactly cc==sizeof(buf) bytes are red. At least in theory.
It does not happen on my systems because it seems that read() get chanks of not more than 4096 bytes (PIPE_BUF ?) while BUFSZ is 8192.

Discussion

  • mezantrop

    mezantrop - 2023-01-01
    • status: open --> accepted
    • Group: --> v1.0 (example)
     
  • mezantrop

    mezantrop - 2023-01-01

    I'm sorry for the lifelong timeout. Will fix, probably like: cc = read(ifd, buf + largv, sizeof(buf) - largv - 1)

     
  • mezantrop

    mezantrop - 2023-01-01

    I'm sorry for the lifelong timeout. Will fix, probably like: cc = read(ifd, buf + largv, sizeof(buf) - largv - 1)

     
  • mezantrop

    mezantrop - 2023-01-01

    Will fix with the solution by Sergey Mironov in the bug report #6

     
  • mezantrop

    mezantrop - 2023-01-01
    • status: accepted --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB
Gen AI apps are built with MongoDB Atlas
Atlas offers built-in vector search and global availability across 125+ regions. Start building AI apps faster, all in one place.