OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.7 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../bluez-hcidump/0006-hcidump-use-correct-size-to-copy-direction-value.patch
  5. # Copyright (C) 2011 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. From 4c52001490ef09a95d4521967e89a8ce2801fd30 Mon Sep 17 00:00:00 2001
  17. From: Iain Hibbert <plunky@rya-online.net>
  18. Date: Thu, 14 Apr 2011 10:08:36 +0100
  19. Subject: [PATCH 6/6] hcidump: use correct size to copy 'direction' value
  20. frm.in is stored as an uint8_t, so we cannot copy an int there
  21. directly. use an intermediate variable so that it also works
  22. on big-endian systems.
  23. ---
  24. src/hcidump.c | 4 +++-
  25. 1 files changed, 3 insertions(+), 1 deletions(-)
  26. diff --git a/src/hcidump.c b/src/hcidump.c
  27. index 2f406db..a966ab2 100644
  28. --- a/src/hcidump.c
  29. +++ b/src/hcidump.c
  30. @@ -281,9 +281,11 @@ static int process_frames(int dev, int sock, int fd, unsigned long flags)
  31. cmsg = CMSG_FIRSTHDR(&msg);
  32. while (cmsg) {
  33. + int dir;
  34. switch (cmsg->cmsg_type) {
  35. case HCI_CMSG_DIR:
  36. - memcpy(&frm.in, CMSG_DATA(cmsg), sizeof(int));
  37. + memcpy(&dir, CMSG_DATA(cmsg), sizeof(int));
  38. + frm.in = (uint8_t) dir;
  39. break;
  40. case HCI_CMSG_TSTAMP:
  41. memcpy(&frm.ts, CMSG_DATA(cmsg),
  42. --
  43. 1.7.2.3