blob: 5012dfe88024f4ead33bfccb336aa3f6da88efbe (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
Fix segmentation fault for release build mode
'int IAFBApi::callSync(...)' is missing a return
statement. When the sdk is compiled in release mode
executing this code results in a segmentation fault.
According to the C++ standard, a return statement is
required on a function that returns a non-void value.
Specifically: <<Flowing off the end of a function is
equivalent to a return with no value; this results in
undefined behaviour in a value-returning function.>>
The proposed fix provides the missing return statement
for IAFBApi's callSync method.
Upstream-Status: Pending
Signed-off-by: Raquel Medina <raquel.medina@konsulko.com>
diff --git a/platforms/agl/alexa-voiceagent-service/src/plugins/afb/AFBApiImpl.cpp b/platforms/agl/alexa-voiceagent-service/src/plugins/afb/AFBApiImpl.cpp
index 5ed9bce..e68ef7f 100644
--- a/src/plugins/afb/AFBApiImpl.cpp
+++ b/src/plugins/afb/AFBApiImpl.cpp
@@ -77,6 +77,8 @@ int AFBApiImpl::callSync(
info = infoStr;
free(infoStr);
}
+
+ return rc;
}
/// Shim to transfer C++ function to C callback using void*
|