This avoids to crash on this example:
\f0\fibi \fcharset0
-------^
Or:
\f0 \fibi\fcharset0
--^
Take into account that I found lots of RTF documents with this format:
\f0\fbidi \froman\fcharset0
\f0\froman\fprq2 \fcharset0
Which are not unsupported by this handler.
Map: FreeBusySimple -> PublicDAndTViewer
FreeBusyDetailed -> ConfidentialDAndTViewer
Although SOGo is not really used AFAIK, we can now keep it and
keep Calendar permission issues consistent.
We have a cache with user contexts (objc) which have mapping contexts (objc)
where we store the indexing context (c) which will be freed by openchange
code once the connection is closed.
Right now all indexing context created for an user are the same,
independently when in time was created or by which connection, etc...
So this is a valid workaround, but this has to be refactored to used the
indexing context of the current connection that is performing the
call to SOGo backend.
This was causing to parse a single space as an empty control
word with length 0, which was the source of several crashes.
Example:
\f0\fbidi \fcharset0
--------^
font index is 0, font family is bidi but when parsing charset we were
assuming control word was '' instead of 'charset0'.
This only fixes the crashes, the parseFontTable function works quite
awful right now.
Different types for keys in Dictionaries leads to not finding
expected entry - we should make sure that everythime we set/get
entry from a dictionary, key object type is same
toManyRelationshipKeysWithNamespaces applies asCSSIdentifier function
to the names which are already "Imap4Encoded". So we need to remove the
CSSIdentifier function first and then "Imap4Decode" to get the real name.
Once we have the real name, to create the url we have to use the same
logic as the function that creates the folder and creates this url for
the first time (this function is createRootSecondaryFolderWithFID)
which is to apply, in this order:
- asCSSIdentifier
- stringByEncodingImap4FolderName
- stringByAddingPercentEscapesUsingEncoding
In a multithread environment, sogo_backend_init is registering the thread
only for the first one that calls this function, then the others threads
(even if they call sogo_backend_init) won't be registered because
moduleInitialized was YES.
We just want to ensure sogo_backend_init is called at least once (per process,
not per thread).
Also, implement reading for message data in case only 1 param is passed.
This could be usefull when have msg data by other means than by
reading it directly from DB
Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
We have thread context already in place during *_init() function.
Thus guarding every API call with TreadInit/Destroy is:
- a bit redundand
- makes SOGo backend not reentrant even on single thread and leads
to hard to find use-after-free crashes
Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
Usually, it is a bad idea for an object to call its own public methods
(just like in this case). Thus separating impelementation for deleteFolder:
would allow MAPIStoreFolder to call only private implementation when needed
Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
possible range of recepients
IMHO, this fixes a bug, that when saving a meessage, it is saved
without BCC fields.
Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>
Most of the time we have "not yet implemented" kind of exceptions,
so it is better to clean up allocated resources
Signed-off-by: Kamen Mazdrashki <kmazdrashki@zentyal.com>