Univention Bugzilla – Attachment 5685 Details for
Bug 33622
UMC crashes with Traceback: IndexError: list index out of range
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fix header parsing of UMCP message.py
bug33622.patch (text/plain), 1.50 KB, created by
Florian Best
on 2013-12-02 10:07:42 CET
(
hide
)
Description:
fix header parsing of UMCP message.py
Filename:
MIME Type:
Creator:
Florian Best
Created:
2013-12-02 10:07:42 CET
Size:
1.50 KB
patch
obsolete
>Index: message.py >=================================================================== >--- message.py (Revision 46358) >+++ message.py (Arbeitskopie) >@@ -190,10 +190,10 @@ > > :raises: :class:`.ParseError`, :class:`.UnknownCommandError`, :class:`.InvalidArgumentsError` > """ >- lines = msg.split( '\n', 1 ) >+ header, nl, body = msg.partition('\n') > > # is the format of the header line valid? >- match = Message._header.match( lines[ 0 ] ) >+ match = Message._header.match(header) > if not match: > raise ParseError( UMCP_ERR_UNPARSABLE_HEADER, _( 'Unparsable message header' ) ) > >@@ -224,18 +224,17 @@ > raise InvalidArgumentsError( UMCP_ERR_ARGS_MISSMATCH, _( "The command '%s' do not have any arguments" ) % self.command ) > > # invalid/missing message body? >- current_length = len( lines[ 1 ] ) >- if len( lines ) < 2 or self._length > current_length: >+ current_length = len(body) >+ if not body or self._length > current_length: > PARSER.info( 'The message body is not complete: %d of %d bytes' % ( current_length, self._length ) ) > raise IncompleteMessageError( _( 'The message body is not (yet) complete' ) ) > > remains = '' >- if len( lines[ 1 ] ) > self._length: >- remains = lines[ 1 ][ self._length : ] >- if len( lines[ 1 ] ) > self._length: >- self.body = lines[ 1 ][ : self._length ] >+ if len(body) > self._length: >+ remains = body[ self._length : ] >+ self.body = body[ : self._length ] > else: >- self.body = lines[ 1 ] >+ self.body = body > > if self.mimetype == MIMETYPE_JSON: > try:
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 33622
: 5685 |
5686