Ticket #2527: jam-hardening.patch
File jam-hardening.patch, 2.5 KB (added by , 14 years ago) |
---|
-
tools/jam/src/compile.c
From Kees Cook, Debian BTS #505734
old new 1404 1404 i = (level+1)*2; 1405 1405 while ( i > 35 ) 1406 1406 { 1407 printf( indent );1407 printf( "%s", indent ); 1408 1408 i -= 35; 1409 1409 } 1410 1410 -
tools/jam/src/make1.c
old new 1018 1018 list_sublist( ns, start, chunk ), 1019 1019 list_new( L0, newstr( "%" ) ) ); 1020 1020 1021 printf( cmd->buf );1021 printf( "%s", cmd->buf ); 1022 1022 1023 1023 exit( EXITBAD ); 1024 1024 } -
tools/jam/src/output.c
old new 20 20 while ( *data ) 21 21 { 22 22 size_t len = strcspn(data,"\r"); 23 fwrite(data,len,1,io);23 do { if (fwrite(data,len,1,io)) {} } while (0); 24 24 data += len; 25 25 if ( *data == '\r' ) ++data; 26 26 } -
tools/jam/src/variable.c
old new 416 416 } 417 417 if ( output_0 < output_1 ) 418 418 { 419 if ( out_file ) fwrite(output_0,output_1-output_0,1,out_file); 420 if ( out_debug ) fwrite(output_0,output_1-output_0,1,stdout); 419 if ( out_file ) { 420 if ( fwrite(output_0,output_1-output_0,1,out_file) < 1 ) { 421 printf( "failed to write output file!\n" ); 422 exit( EXITBAD ); 423 } 424 } 425 if ( out_debug ) { 426 if ( fwrite(output_0,output_1-output_0,1,stdout) < 1 ) { 427 printf( "failed to write output to stdout!\n" ); 428 exit( EXITBAD ); 429 } 430 } 421 431 } 422 432 output_0 = output_1; 423 433 … … 457 467 } 458 468 else if ( output_0 < output_1 ) 459 469 { 460 if ( out_file ) fwrite(output_0,output_1-output_0,1,out_file); 461 if ( out_debug ) fwrite(output_0,output_1-output_0,1,stdout); 470 if ( out_file ) { 471 if ( fwrite(output_0,output_1-output_0,1,out_file) < 1 ) { 472 printf( "failed to write output file!\n" ); 473 exit( EXITBAD ); 474 } 475 } 476 if ( out_debug ) { 477 if ( fwrite(output_0,output_1-output_0,1,stdout) < 1 ) { 478 printf( "failed to write output to stdout!\n" ); 479 exit( EXITBAD ); 480 } 481 } 462 482 } 463 483 464 484 in = output_1;