Merge "Add buffer length check for XTRA data"
This commit is contained in:
commit
1e19c369f9
2 changed files with 8 additions and 2 deletions
|
@ -801,8 +801,12 @@ SIDE EFFECTS
|
||||||
static int loc_xtra_inject_data(char* data, int length)
|
static int loc_xtra_inject_data(char* data, int length)
|
||||||
{
|
{
|
||||||
ENTRY_LOG();
|
ENTRY_LOG();
|
||||||
int ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length);
|
int ret_val = -1;
|
||||||
|
if( (data != NULL) && ((unsigned int)length <= XTRA_DATA_MAX_SIZE))
|
||||||
|
ret_val = loc_eng_xtra_inject_data(loc_afw_data, data, length);
|
||||||
|
else
|
||||||
|
LOC_LOGE("%s, Could not inject XTRA data. Buffer address: %p, length: %d",
|
||||||
|
__func__, data, length);
|
||||||
EXIT_LOG(%d, ret_val);
|
EXIT_LOG(%d, ret_val);
|
||||||
return ret_val;
|
return ret_val;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,8 @@ extern "C" {
|
||||||
#include <hardware/gps.h>
|
#include <hardware/gps.h>
|
||||||
#include <gps_extended.h>
|
#include <gps_extended.h>
|
||||||
|
|
||||||
|
#define XTRA_DATA_MAX_SIZE 100000 /*bytes*/
|
||||||
|
|
||||||
typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt);
|
typedef void (*loc_location_cb_ext) (UlpLocation* location, void* locExt);
|
||||||
typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt);
|
typedef void (*loc_sv_status_cb_ext) (GpsSvStatus* sv_status, void* svExt);
|
||||||
typedef void* (*loc_ext_parser)(void* data);
|
typedef void* (*loc_ext_parser)(void* data);
|
||||||
|
|
Loading…
Reference in a new issue