mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.4 KiB

  1. Use of tainted arguments in exec is deprecated at /var/www/cgi-bin/cvsweb.cgi line 2043.
  2. ===================================================================
  3. RCS file: /home2/webcvs/mirror/kdepim/libkdenetwork/kmime_codec_qp.cpp,v
  4. retrieving revision 1.12
  5. retrieving revision 1.13
  6. diff -u -p -r1.12 -r1.13
  7. --- kdepim/libkdenetwork/kmime_codec_qp.cpp 2003/07/26 14:51:52 1.12
  8. +++ kdepim/libkdenetwork/kmime_codec_qp.cpp 2003/10/30 14:15:30 1.13
  9. @@ -189,6 +189,20 @@ public:
  10. bool finish( char* & dcursor, const char * const dend );
  11. };
  12. +// this doesn't access any member variables, so it can be defined static
  13. +// but then we can't call it from virtual functions
  14. +static int QuotedPrintableDecoder_maxDecodedSizeFor( int insize, bool withCRLF ) {
  15. + // all chars unencoded:
  16. + int result = insize;
  17. + // but maybe all of them are \n and we need to make them \r\n :-o
  18. + if ( withCRLF )
  19. + result += insize;
  20. +
  21. + // there might be an accu plus escape
  22. + result += 2;
  23. +
  24. + return result;
  25. +}
  26. Encoder * QuotedPrintableCodec::makeEncoder( bool withCRLF ) const {
  27. return new QuotedPrintableEncoder( withCRLF );
  28. @@ -198,6 +212,10 @@ Decoder * QuotedPrintableCodec::makeDeco
  29. return new QuotedPrintableDecoder( withCRLF );
  30. }
  31. +int QuotedPrintableCodec::maxDecodedSizeFor( int insize, bool withCRLF ) const {
  32. + return QuotedPrintableDecoder_maxDecodedSizeFor(insize, withCRLF);
  33. +}
  34. +
  35. Encoder * Rfc2047QEncodingCodec::makeEncoder( bool withCRLF ) const {
  36. return new Rfc2047QEncodingEncoder( withCRLF );
  37. }
  38. @@ -206,6 +224,10 @@ Decoder * Rfc2047QEncodingCodec::makeDec
  39. return new QuotedPrintableDecoder( withCRLF, true );
  40. }
  41. +int Rfc2047QEncodingCodec::maxDecodedSizeFor( int insize, bool withCRLF ) const {
  42. + return QuotedPrintableDecoder_maxDecodedSizeFor(insize, withCRLF);
  43. +}
  44. +
  45. Encoder * Rfc2231EncodingCodec::makeEncoder( bool withCRLF ) const {
  46. return new Rfc2047QEncodingEncoder( withCRLF, '%' );
  47. }
  48. @@ -214,12 +236,14 @@ Decoder * Rfc2231EncodingCodec::makeDeco
  49. return new QuotedPrintableDecoder( withCRLF, true, '%' );
  50. }
  51. +int Rfc2231EncodingCodec::maxDecodedSizeFor( int insize, bool withCRLF ) const {
  52. + return QuotedPrintableDecoder_maxDecodedSizeFor(insize, withCRLF);
  53. +}
  54. /********************************************************/
  55. /********************************************************/
  56. /********************************************************/
  57. -
  58. bool QuotedPrintableDecoder::decode( const char* & scursor, const char * const send,
  59. char* & dcursor, const char * const dend ) {
  60. if ( mWithCRLF )
  61. @@ -402,7 +426,7 @@ bool QuotedPrintableEncoder::processNext
  62. bufferFill += 16;
  63. assert( bufferFill >=0 && bufferFill <= 15 );
  64. -
  65. +
  66. if ( !mFinishing && !mSawLineEnd &&
  67. bufferFill < minBufferFillWithoutLineEnd )
  68. return false;
  69. @@ -424,7 +448,7 @@ bool QuotedPrintableEncoder::processNext
  70. else
  71. // never needs encoding
  72. mAccuNeedsEncoding = Never;
  73. -
  74. +
  75. return true;
  76. }
  77. @@ -485,7 +509,7 @@ bool QuotedPrintableEncoder::encode( con
  78. // fill input buffer until eol has been reached or until the
  79. // buffer is full, whatever comes first:
  80. fillInputBuffer( scursor, send );
  81. -
  82. +
  83. if ( processNextChar() )
  84. // there was one...
  85. createOutputBuffer( dcursor, dend );
  86. @@ -506,7 +530,7 @@ bool QuotedPrintableEncoder::encode( con
  87. if ( mOutputBufferCursor ) flushOutputBuffer( dcursor, dend );
  88. return (scursor == send);
  89. -
  90. +
  91. } // encode
  92. bool QuotedPrintableEncoder::finish( char* & dcursor,