[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r13135: bulletproof option_get_canonical_name() (in tor/trunk: . src/or)



Author: nickm
Date: 2008-01-15 00:57:14 -0500 (Tue, 15 Jan 2008)
New Revision: 13135

Modified:
   tor/trunk/
   tor/trunk/src/or/config.c
Log:
 r17623@catbus:  nickm | 2008-01-15 00:22:04 -0500
 bulletproof option_get_canonical_name()



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r17623] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2008-01-14 19:03:33 UTC (rev 13134)
+++ tor/trunk/src/or/config.c	2008-01-15 05:57:14 UTC (rev 13135)
@@ -1683,12 +1683,13 @@
   return (var != NULL);
 }
 
-/** Return the canonical name of a configuration option. */
+/** Return the canonical name of a configuration option, or NULL
+ * if no such option exists. */
 const char *
 option_get_canonical_name(const char *key)
 {
   config_var_t *var = config_find_option(&options_format, key);
-  return var->name;
+  return var ? var->name : NULL;
 }
 
 /** Return a canonicalized list of the options assigned for key.