[Telepathy-commits] [telepathy-salut/master] salut_ft_manager_handle_request: check if ContentHashType is valid
Guillaume Desmottes
guillaume.desmottes at collabora.co.uk
Tue Nov 11 08:33:16 PST 2008
---
src/salut-ft-manager.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/salut-ft-manager.c b/src/salut-ft-manager.c
index 7a15d25..b746424 100644
--- a/src/salut-ft-manager.c
+++ b/src/salut-ft-manager.c
@@ -391,6 +391,15 @@ salut_ft_manager_handle_request (TpChannelManager *manager,
/* Assume File_Hash_Type_None */
content_hash_type = SALUT_FILE_HASH_TYPE_NONE;
}
+ else
+ {
+ if (content_hash_type >= NUM_SALUT_FILE_HASH_TYPES)
+ {
+ g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
+ "%u is not a valid ContentHashType", content_hash_type);
+ goto error;
+ }
+ }
if (content_hash_type != SALUT_FILE_HASH_TYPE_NONE)
{
--
1.5.6.5
More information about the Telepathy-commits
mailing list