diff options
Diffstat (limited to 'src/main/extractor_ipc.c')
-rw-r--r-- | src/main/extractor_ipc.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/extractor_ipc.c b/src/main/extractor_ipc.c index 4c8a14d..2d935df 100644 --- a/src/main/extractor_ipc.c +++ b/src/main/extractor_ipc.c | |||
@@ -23,6 +23,7 @@ | |||
23 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
24 | */ | 24 | */ |
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #include "extractor_logging.h" | ||
26 | #include "extractor_ipc.h" | 27 | #include "extractor_ipc.h" |
27 | #include "extractor_plugins.h" | 28 | #include "extractor_plugins.h" |
28 | 29 | ||
@@ -78,7 +79,10 @@ EXTRACTOR_IPC_process_reply_ (struct EXTRACTOR_PluginList *plugin, | |||
78 | memcpy (&meta, cdata, sizeof (meta)); | 79 | memcpy (&meta, cdata, sizeof (meta)); |
79 | /* check hdr for sanity */ | 80 | /* check hdr for sanity */ |
80 | if (meta.value_size > MAX_META_DATA) | 81 | if (meta.value_size > MAX_META_DATA) |
81 | return -1; /* not allowing more than MAX_META_DATA meta data */ | 82 | { |
83 | LOG ("Meta data exceeds size limit\n"); | ||
84 | return -1; /* not allowing more than MAX_META_DATA meta data */ | ||
85 | } | ||
82 | if (size < sizeof (meta) + meta.mime_length + meta.value_size) | 86 | if (size < sizeof (meta) + meta.mime_length + meta.value_size) |
83 | { | 87 | { |
84 | plugin->seek_request = -1; | 88 | plugin->seek_request = -1; |
@@ -92,7 +96,10 @@ EXTRACTOR_IPC_process_reply_ (struct EXTRACTOR_PluginList *plugin, | |||
92 | { | 96 | { |
93 | mime_type = &cdata[sizeof (struct MetaMessage)]; | 97 | mime_type = &cdata[sizeof (struct MetaMessage)]; |
94 | if ('\0' != mime_type[meta.mime_length - 1]) | 98 | if ('\0' != mime_type[meta.mime_length - 1]) |
95 | return -1; | 99 | { |
100 | LOG ("Mime type not 0-terminated\n"); | ||
101 | return -1; | ||
102 | } | ||
96 | } | 103 | } |
97 | if (0 == meta.value_size) | 104 | if (0 == meta.value_size) |
98 | value = NULL; | 105 | value = NULL; |
@@ -106,6 +113,7 @@ EXTRACTOR_IPC_process_reply_ (struct EXTRACTOR_PluginList *plugin, | |||
106 | mime_type, value); | 113 | mime_type, value); |
107 | return sizeof (struct MetaMessage) + meta.mime_length + meta.value_size; | 114 | return sizeof (struct MetaMessage) + meta.mime_length + meta.value_size; |
108 | default: | 115 | default: |
116 | LOG ("Invalid message type %d\n", (int) code); | ||
109 | return -1; | 117 | return -1; |
110 | } | 118 | } |
111 | } | 119 | } |