diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-27 12:46:48 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-27 12:46:48 +0000 |
commit | 602c664c1e66ec128b524fe706c63776d1e9b404 (patch) | |
tree | af6622e089aeff394fd6f0dce1690e4634119817 /src/util/container_meta_data.c | |
parent | b28ebda18f5efe2b59c0a3f318b672821e00c481 (diff) | |
download | gnunet-602c664c1e66ec128b524fe706c63776d1e9b404.tar.gz gnunet-602c664c1e66ec128b524fe706c63776d1e9b404.zip |
tolerate md==NULL
Diffstat (limited to 'src/util/container_meta_data.c')
-rw-r--r-- | src/util/container_meta_data.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/util/container_meta_data.c b/src/util/container_meta_data.c index dd7165ba9..3f2d7a95c 100644 --- a/src/util/container_meta_data.c +++ b/src/util/container_meta_data.c | |||
@@ -474,6 +474,8 @@ GNUNET_CONTAINER_meta_data_iterate (const struct | |||
474 | { | 474 | { |
475 | struct MetaItem *pos; | 475 | struct MetaItem *pos; |
476 | 476 | ||
477 | if (md == NULL) | ||
478 | return 0; | ||
477 | if (iter == NULL) | 479 | if (iter == NULL) |
478 | return md->item_count; | 480 | return md->item_count; |
479 | pos = md->items; | 481 | pos = md->items; |
@@ -509,6 +511,8 @@ GNUNET_CONTAINER_meta_data_get_by_type (const struct GNUNET_CONTAINER_MetaData | |||
509 | { | 511 | { |
510 | struct MetaItem *pos; | 512 | struct MetaItem *pos; |
511 | 513 | ||
514 | if (md == NULL) | ||
515 | return NULL; | ||
512 | pos = md->items; | 516 | pos = md->items; |
513 | while (NULL != pos) | 517 | while (NULL != pos) |
514 | { | 518 | { |
@@ -542,6 +546,8 @@ GNUNET_CONTAINER_meta_data_get_first_by_types (const struct | |||
542 | va_list args; | 546 | va_list args; |
543 | enum EXTRACTOR_MetaType type; | 547 | enum EXTRACTOR_MetaType type; |
544 | 548 | ||
549 | if (md == NULL) | ||
550 | return NULL; | ||
545 | ret = NULL; | 551 | ret = NULL; |
546 | va_start (args, md); | 552 | va_start (args, md); |
547 | while (1) | 553 | while (1) |
@@ -574,6 +580,8 @@ GNUNET_CONTAINER_meta_data_get_thumbnail (const struct | |||
574 | struct MetaItem *pos; | 580 | struct MetaItem *pos; |
575 | struct MetaItem *match; | 581 | struct MetaItem *match; |
576 | 582 | ||
583 | if (md == NULL) | ||
584 | return 0; | ||
577 | match = NULL; | 585 | match = NULL; |
578 | pos = md->items; | 586 | pos = md->items; |
579 | while (NULL != pos) | 587 | while (NULL != pos) |