Fix: Make sure we don't overflow the buffer

This commit is contained in:
Denis Kenzior 2009-12-01 16:05:20 -06:00
parent a514983981
commit 184eb91aa6
2 changed files with 8 additions and 2 deletions

View File

@ -44,6 +44,9 @@
#define HSO_CONNECTING 2
#define HSO_FAILED 3
#define AUTH_BUF_LENGTH OFONO_GPRS_MAX_USERNAME_LENGTH + \
OFONO_GPRS_MAX_PASSWORD_LENGTH + 128
static const char *none_prefix[] = { NULL };
static const char *owandata_prefix[] = { "_OWANDATA:", NULL };
@ -151,7 +154,7 @@ static void hso_gprs_activate_primary(struct ofono_gprs_context *gc,
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[OFONO_GPRS_MAX_APN_LENGTH + 128];
char buf[AUTH_BUF_LENGTH];
int len;
if (!cbd)

View File

@ -43,6 +43,9 @@
#define MBM_E2NAP_CONNECTED 1
#define MBM_E2NAP_CONNECTING 2
#define AUTH_BUF_LENGTH OFONO_GPRS_MAX_USERNAME_LENGTH + \
OFONO_GPRS_MAX_PASSWORD_LENGTH + 128
static const char *none_prefix[] = { NULL };
struct gprs_context_data {
@ -132,7 +135,7 @@ static void mbm_gprs_activate_primary(struct ofono_gprs_context *gc,
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[OFONO_GPRS_MAX_APN_LENGTH + 128];
char buf[AUTH_BUF_LENGTH];
int len;
if (!cbd)