From Kees Cook, Debian BTS #505734 --- boost1.37-1.37.0.orig/tools/jam/src/compile.c +++ boost1.37-1.37.0/tools/jam/src/compile.c @@ -1404,7 +1404,7 @@ i = (level+1)*2; while ( i > 35 ) { - printf( indent ); + printf( "%s", indent ); i -= 35; } --- boost1.37-1.37.0.orig/tools/jam/src/make1.c +++ boost1.37-1.37.0/tools/jam/src/make1.c @@ -1018,7 +1018,7 @@ list_sublist( ns, start, chunk ), list_new( L0, newstr( "%" ) ) ); - printf( cmd->buf ); + printf( "%s", cmd->buf ); exit( EXITBAD ); } --- boost1.37-1.37.0.orig/tools/jam/src/output.c +++ boost1.37-1.37.0/tools/jam/src/output.c @@ -20,7 +20,7 @@ while ( *data ) { size_t len = strcspn(data,"\r"); - fwrite(data,len,1,io); + do { if (fwrite(data,len,1,io)) {} } while (0); data += len; if ( *data == '\r' ) ++data; } --- boost1.37-1.37.0.orig/tools/jam/src/variable.c +++ boost1.37-1.37.0/tools/jam/src/variable.c @@ -416,8 +416,18 @@ } if ( output_0 < output_1 ) { - if ( out_file ) fwrite(output_0,output_1-output_0,1,out_file); - if ( out_debug ) fwrite(output_0,output_1-output_0,1,stdout); + if ( out_file ) { + if ( fwrite(output_0,output_1-output_0,1,out_file) < 1 ) { + printf( "failed to write output file!\n" ); + exit( EXITBAD ); + } + } + if ( out_debug ) { + if ( fwrite(output_0,output_1-output_0,1,stdout) < 1 ) { + printf( "failed to write output to stdout!\n" ); + exit( EXITBAD ); + } + } } output_0 = output_1; @@ -457,8 +467,18 @@ } else if ( output_0 < output_1 ) { - if ( out_file ) fwrite(output_0,output_1-output_0,1,out_file); - if ( out_debug ) fwrite(output_0,output_1-output_0,1,stdout); + if ( out_file ) { + if ( fwrite(output_0,output_1-output_0,1,out_file) < 1 ) { + printf( "failed to write output file!\n" ); + exit( EXITBAD ); + } + } + if ( out_debug ) { + if ( fwrite(output_0,output_1-output_0,1,stdout) < 1 ) { + printf( "failed to write output to stdout!\n" ); + exit( EXITBAD ); + } + } } in = output_1;