Open Source Telephony
 help / color / mirror / Atom feed
* [PATCH 1/2] stk: Fix sizeof on memcpy
@ 2013-05-22 23:01 Lucas De Marchi
  2013-05-22 23:01 ` [PATCH 2/2] gitignore: Ignore file generated by Automake 1.13 Lucas De Marchi
  2013-05-23  2:38 ` [PATCH 1/2] stk: Fix sizeof on memcpy Denis Kenzior
  0 siblings, 2 replies; 4+ messages in thread
From: Lucas De Marchi @ 2013-05-22 23:01 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 924 bytes --]

src/stk.c: In function ‘__ofono_cbs_sim_download’:
src/stk.c:283:45: error: argument to ‘sizeof’ in ‘memcpy’ call is the
same expression as the source; did you mean to dereference it?
[-Werror=sizeof-pointer-memaccess]
  memcpy(&e.cbs_pp_download.page, msg, sizeof(msg));
                                               ^
---
 src/stk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/stk.c b/src/stk.c
index 7974751..01c95b5 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -280,7 +280,7 @@ void __ofono_cbs_sim_download(struct ofono_stk *stk, const struct cbs *msg)
 
 	e.type = STK_ENVELOPE_TYPE_CBS_PP_DOWNLOAD;
 	e.src = STK_DEVICE_IDENTITY_TYPE_NETWORK;
-	memcpy(&e.cbs_pp_download.page, msg, sizeof(msg));
+	memcpy(&e.cbs_pp_download.page, msg, sizeof(*msg));
 
 	err = stk_send_envelope(stk, &e, stk_cbs_download_cb,
 				ENVELOPE_RETRIES_DEFAULT);
-- 
1.8.2.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-05-23  2:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-22 23:01 [PATCH 1/2] stk: Fix sizeof on memcpy Lucas De Marchi
2013-05-22 23:01 ` [PATCH 2/2] gitignore: Ignore file generated by Automake 1.13 Lucas De Marchi
2013-05-23  2:39   ` Denis Kenzior
2013-05-23  2:38 ` [PATCH 1/2] stk: Fix sizeof on memcpy Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox