This patch makes the function setvbuf more robust by checking the bmode parameter. --- orig/setvbuf.c Sun Sep 6 05:00:32 1992 +++ setvbuf.c Sat Aug 27 17:13:12 1994 @@ -10,6 +10,8 @@ int bmode; size_t size; { + if (bmode != _IOFBF && bmode != _IOLBF && bmode != _IONBF) + return -1; if(fp->_flag & _IOMYBUF) free(fp->_base); fp->_flag &= ~(_IOFBF | _IOLBF | _IONBF | _IOMYBUF);