Skip to content

Commit b9a640a

Browse files
daztuckerdjmdjm
authored andcommitted
upstream: If write() returned short, the subsequent write would restart
from the beginning of the buffer not the end of what was written. Fix, since we want modpipe to corrupt data for testing purposes deliberately not accidentally. ok djm@ OpenBSD-Regress-ID: 50ca74d287445c58944f070bb92dc13b1d054b43
1 parent a0e5446 commit b9a640a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

regress/modpipe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1515
*/
1616

17-
/* $OpenBSD: modpipe.c,v 1.6 2013/11/21 03:16:47 djm Exp $ */
17+
/* $OpenBSD: modpipe.c,v 1.7 2025/10/03 01:03:45 dtucker Exp $ */
1818

1919
#include "includes.h"
2020

@@ -127,7 +127,7 @@ main(int argc, char **argv)
127127
}
128128
}
129129
for (o = 0; o < s; o += r) {
130-
r = write(STDOUT_FILENO, buf, s - o);
130+
r = write(STDOUT_FILENO, buf + o, s - o);
131131
if (r == 0)
132132
break;
133133
if (r < 0) {

0 commit comments

Comments
 (0)