diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 17204fda5626bdad1cb9449edf8dce5373e541d6..d657920c3ff8ca839f664bed2667ab21ef9f3247 100644
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -1155,7 +1155,7 @@ static int restart_monitor()
 	return 0;
 }
 
-static struct phone_pvt *mkif(char *iface, int mode, int txgain, int rxgain)
+static struct phone_pvt *mkif(const char *iface, int mode, int txgain, int rxgain)
 {
 	/* Make a phone_pvt structure for this interface */
 	struct phone_pvt *tmp;
@@ -1258,7 +1258,7 @@ static struct ast_channel *phone_request(const char *type, int format, void *dat
 }
 
 /* parse gain value from config file */
-static int parse_gain_value(char *gain_type, char *value)
+static int parse_gain_value(const char *gain_type, const char *value)
 {
 	float gain;
 
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index 6c9723e65a788dfb6bc1bfaae98c6adbacdc9e79..2ea37472cf9064ace677d01a7f3fbd664ca8b9f0 100644
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -12246,7 +12246,7 @@ static int build_channels(struct zt_chan_conf conf, int iscrv, const char *value
 static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int reload, int skipchannels)
 {
 	struct zt_pvt *tmp;
-	char *ringc; /* temporary string for parsing the dring number. */
+	const char *ringc; /* temporary string for parsing the dring number. */
 	int y;
 	int found_pseudo = 0;
         char zapchan[MAX_CHANLIST_LEN] = {};
@@ -12785,9 +12785,9 @@ static int process_zap(struct zt_chan_conf *confp, struct ast_variable *v, int r
 				}
 			} else if (!strcasecmp(v->name, "pritimer")) {
 #ifdef PRI_GETSET_TIMERS
-				char *timerc, *c;
+				char tmp[20], *timerc, *c = tmp;
 				int timer, timeridx;
-				c = v->value;
+				ast_copy_string(tmp, v->value, sizeof(tmp));
 				timerc = strsep(&c, ",");
 				if (timerc) {
 					timer = atoi(c);
diff --git a/main/config.c b/main/config.c
index f02f3014b97a4bb4c312725aef41ef03193f9057..134add80a3d53b175de2318180b4f2c0348e78e2 100644
--- a/main/config.c
+++ b/main/config.c
@@ -267,7 +267,7 @@ struct ast_variable *ast_variable_new(const char *name, const char *value, const
 		variable->name = strcpy(dst, name);
 		dst += name_len;
 		variable->value = strcpy(dst, value);
-		dst += fn_len;
+		dst += val_len;
 		variable->file = strcpy(dst, filename);
 	}
 	return variable;
diff --git a/res/res_config_sqlite.c b/res/res_config_sqlite.c
index d05a38237bbf4217bcfbb03c13a63cdc8e59a079..53987cc9aee0a6a9047b16e613e5a9b72c579619 100644
--- a/res/res_config_sqlite.c
+++ b/res/res_config_sqlite.c
@@ -215,7 +215,7 @@ struct rt_multi_cfg_entry_args {
  * \retval 0 on success
  * \retval 1 if an allocation error occurred
  */
-static int set_var(char **var, char *name, char *value);
+static int set_var(char **var, const char *name, const char *value);
 
 /*!
  * \brief Load the configuration file.
@@ -587,7 +587,7 @@ static char *sql_get_config_table =
 "	WHERE filename = '%q' AND commented = 0"
 "	ORDER BY cat_metric ASC, var_metric ASC;";
 
-static int set_var(char **var, char *name, char *value)
+static int set_var(char **var, const char *name, const char *value)
 {
 	if (*var)
 		ast_free(*var);
diff --git a/res/res_jabber.c b/res/res_jabber.c
index 464f6a22c97944e3235dd8864a7074e8ca0e5094..6dfcb9a2543a5bd21253566dcdfba0f8bb52f1fa 100644
--- a/res/res_jabber.c
+++ b/res/res_jabber.c
@@ -2650,7 +2650,7 @@ static int aji_create_client(char *label, struct ast_variable *var, int debug)
 		else if (!strcasecmp(var->name, "autoregister"))
 			ast_set2_flag(client, ast_true(var->value), AJI_AUTOREGISTER);
 		else if (!strcasecmp(var->name, "buddy"))
-				aji_create_buddy(var->value, client);
+			aji_create_buddy((char *)var->value, client);
 		else if (!strcasecmp(var->name, "priority"))
 			client->priority = atoi(var->value);
 		else if (!strcasecmp(var->name, "status")) {
diff --git a/res/res_odbc.c b/res/res_odbc.c
index 0b3887232e7db85a6618d3d014d44d54febd5d2a..8d3a4da0bfb419a24e8dead10a0b633e02f05620 100644
--- a/res/res_odbc.c
+++ b/res/res_odbc.c
@@ -232,7 +232,8 @@ static int load_odbc_config(void)
 	static char *cfg = "res_odbc.conf";
 	struct ast_config *config;
 	struct ast_variable *v;
-	char *cat, *dsn, *username, *password, *sanitysql;
+	char *cat;
+	const char *dsn, *username, *password, *sanitysql;
 	int enabled, pooling, limit;
 	int connect = 0, res = 0;
 	struct ast_flags config_flags = { 0 };
@@ -581,7 +582,8 @@ static int reload(void)
 	static char *cfg = "res_odbc.conf";
 	struct ast_config *config;
 	struct ast_variable *v;
-	char *cat, *dsn, *username, *password, *sanitysql;
+	char *cat;
+	const char *dsn, *username, *password, *sanitysql;
 	int enabled, pooling, limit;
 	int connect = 0, res = 0;
 	struct ast_flags config_flags = { CONFIG_FLAG_FILEUNCHANGED };