Skip to content

Commit

Permalink
[usb-moded] If no ip is set, make sure there is a default value defin…
Browse files Browse the repository at this point in the history
…ed otherwise writing out the udhcpcd config will crash

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
  • Loading branch information
philippedeswert committed Dec 13, 2013
1 parent fce2e9a commit 1a63c94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
@@ -1,4 +1,4 @@
AC_INIT([usb_moded], [0.77.2])
AC_INIT([usb_moded], [0.77.3])
AM_INIT_AUTOMAKE([-Wall -Werror foreign])

AM_CONFIG_HEADER([config.h])
Expand Down
4 changes: 4 additions & 0 deletions src/usb_moded-network.c
Expand Up @@ -140,6 +140,10 @@ static int write_udhcpd_conf(ipforward_data *ipforward, struct mode_list_elem *d

/* generate start and end ip based on the setting */
ip = get_network_ip();
if(ip == NULL)
{
ip = strdup("192.168.2.15");
}
ipstart = malloc(sizeof(char)*15);
ipend = malloc(sizeof(char)*15);
while(i < 15)
Expand Down

0 comments on commit 1a63c94

Please sign in to comment.