Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit dd859d09 authored by Sharvil Nanavati's avatar Sharvil Nanavati
Browse files

Fix crash in HFP client's +COPS parsing code.

If the Audio Gateway sends a malformed +COPS message (an operator
name > 16 characters) then the %n in sscanf format specifier is
ignored and sscanf will not assign a value to the appropriate
argument.

In such a case, the existing code will perform pointer arithmetic
using an uninitialized stack variable as an offset which may result
in pointing to an invalid memory address. When that memory is
subsequently dereferenced, we observe a crash.

This change ensures that the stack does not crash even if an invalid
+COPS message is sent from the Audio Gateway.

Bug: 24871011
Change-Id: I9bb42c75bcd90487831fc6950c571c87098559e7
parent 98168c26
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment