}
}
+static bool __ctsvc_vcard_has_unsupported_format(const char *row)
+{
+ RETV_IF(NULL == row, false);
+
+ char *xcustom1 = strstr(row, "XCUSTOM");
+ char *xcustom2 = strstr(row, "X-CUSTOM");
+ char *quoted1 = strstr(row, "QUOTEDPRINTABLE");
+ char *quoted2 = strstr(row, "QUOTED-PRINTABLE");
+ char *end_of_raw = strchr(row, '\n');
+ bool has_xcustom = false;
+ bool has_quoted = false;
+
+ if ((xcustom1 != NULL && xcustom1 < end_of_raw) ||(xcustom2 != NULL && xcustom2 < end_of_raw))
+ has_xcustom = true;
+
+ if ((quoted1 != NULL && quoted1 < end_of_raw) ||(quoted2 != NULL && quoted2 < end_of_raw))
+ has_quoted = true;
+
+ /* quoted-printable is not supported in custom type */
+ if (has_xcustom && has_quoted) {
+ INFO("This row has unsupported format");
+ return true;
+ }
+
+ return false;
+}
+
static inline char* __ctsvc_vcard_pass_unsupported(char *vcard)
{
while (*vcard) {
return NULL;
}
-static void __ctsvc_vcard_get_prefix(char **prefix, char *src)
+static void __ctsvc_vcard_get_prefix(char **prefix, const char *src)
{
char *temp = strchr(src, ':');
if (temp) {
bool base64_encoded = false;
type = __ctsvc_vcard_check_content_type(&cursor);
- if (CTSVC_VCARD_VALUE_NONE == type) {
+ if (CTSVC_VCARD_VALUE_NONE == type || __ctsvc_vcard_has_unsupported_format(cursor)) {
new_start = __ctsvc_vcard_pass_unsupported(cursor);
if (new_start) {
cursor = new_start;