Minor checks to prevent NULL-pointer exceptions
(cherry picked from commit c295b834a2554b3f7eb792f1bc6d445e206fa55d)
diff --git a/include/polarssl/md.h b/include/polarssl/md.h
index 88596cb..6a1bdd4 100644
--- a/include/polarssl/md.h
+++ b/include/polarssl/md.h
@@ -198,6 +198,9 @@
  */
 static inline unsigned char md_get_size( const md_info_t *md_info )
 {
+    if( md_info == NULL )
+        return( 0 );
+
     return md_info->size;
 }
 
@@ -210,6 +213,9 @@
  */
 static inline md_type_t md_get_type( const md_info_t *md_info )
 {
+    if( md_info == NULL )
+        return( POLARSSL_MD_NONE );
+
     return md_info->type;
 }
 
@@ -222,6 +228,9 @@
  */
 static inline const char *md_get_name( const md_info_t *md_info )
 {
+    if( md_info == NULL )
+        return( NULL );
+
     return md_info->name;
 }