Merge pull request #116 from bkokoszx/logger-rejecting-trace-address
logger: refinement handling invalid trace address
This commit is contained in:
commit
b5eb15516c
|
@ -282,10 +282,17 @@ static int logger_read(struct convert_config *config,
|
||||||
return -ferror(config->in_fd);
|
return -ferror(config->in_fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* checking log address */
|
/* checking if received trace address is located in
|
||||||
|
* entry section in elf file.
|
||||||
|
*/
|
||||||
if ((dma_log.address < snd->base_address) ||
|
if ((dma_log.address < snd->base_address) ||
|
||||||
dma_log.address > snd->base_address + snd->data_length)
|
dma_log.address > snd->base_address + snd->data_length) {
|
||||||
|
/* in case the address is not correct input fd should be
|
||||||
|
* move forward by one DWORD, not entire struct dma_log
|
||||||
|
*/
|
||||||
|
fseek(config->in_fd, -(sizeof(dma_log) - sizeof(uint32_t)), SEEK_CUR);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* fetching entry from elf dump */
|
/* fetching entry from elf dump */
|
||||||
ret = fetch_entry(config, snd->base_address, snd->data_offset,
|
ret = fetch_entry(config, snd->base_address, snd->data_offset,
|
||||||
|
|
Loading…
Reference in New Issue