<?xml version="1.0" encoding="UTF-8" ?>

<bugzilla version="5.2"
          urlbase="https://bugzilla.altlinux.org/"
          
          maintainer="jenya@basealt.ru"
>

    <bug>
          <bug_id>49192</bug_id>
          
          <creation_ts>2024-01-25 18:23:34 +0300</creation_ts>
          <short_desc>баг в libcwiid</short_desc>
          <delta_ts>2024-01-29 15:19:22 +0300</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>4</classification_id>
          <classification>Development</classification>
          <product>Sisyphus</product>
          <component>libcwiid</component>
          <version>unstable</version>
          <rep_platform>x86_64</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Егор">petruhin-enot</reporter>
          <assigned_to name="Nobody&apos;s working on this, feel free to take it">nobody</assigned_to>
          <cc>iqqator</cc>
    
    <cc>oleg</cc>
          
          <qa_contact>qa-sisyphus</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>240650</commentid>
    <comment_count>0</comment_count>
    <who name="Егор">petruhin-enot</who>
    <bug_when>2024-01-25 18:23:34 +0300</bug_when>
    <thetext>Запустил wmgui, нажал на кнопку connect и зажал на wiiremote 1+2 и нажал ok, программа зависла. Зависает на 

* thread #1, name = &apos;wmgui&apos;, stop reason = step over
    frame #0: 0x00007ffff7e89aaf libcwiid.so.1`cwiid_send_rpt(wiimote=0x0000555555737320, flags=&apos;\0&apos;, report=&apos;\x11&apos;, len=1, data=0x00007fffffffd6f7) at command.c:65:2
   62  	
   63  		buf[0] = BT_TRANS_SET_REPORT | BT_PARAM_OUTPUT;
   64  		buf[1] = report;
-&gt; 65  		memcpy(buf+2, data, len);
   66  		if (!(flags &amp; CWIID_SEND_RPT_NO_RUMBLE)) {реп
   67  			buf[2] |= wiimote-&gt;state.rumble;
   68  		}
видимо буфер переполняется</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240653</commentid>
    <comment_count>1</comment_count>
    <who name="iQQator">iqqator</who>
    <bug_when>2024-01-25 18:40:33 +0300</bug_when>
    <thetext>Шаги воспроизведения:
1.
2.
3.

Ожидаемый результат
-  Все работает

Фактический результат
- Приложение зависает на моменте подключения

Проведенный анализ
- Проверили приложение при помощи lldb и debug версии пакета
- Проставили брэкпоинты и нашли место после которого приложение не отвечает совсем

- Во время исполнения 65 строчки происходит зависание
```
* thread #1, name = &apos;wmgui&apos;, stop reason = step over
    frame #0: 0x00007ffff7e89aaf libcwiid.so.1`cwiid_send_rpt(wiimote=0x0000555555737320, flags=&apos;\0&apos;, report=&apos;\x11&apos;, len=1, data=0x00007fffffffd6f7) at command.c:65:2
   62    
   63      buf[0] = BT_TRANS_SET_REPORT | BT_PARAM_OUTPUT;
   64      buf[1] = report;
-&gt; 65      memcpy(buf+2, data, len);
   66      if (!(flags &amp; CWIID_SEND_RPT_NO_RUMBLE)) {реп
   67        buf[2] |= wiimote-&gt;state.rumble;
   68      }
``</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>240827</commentid>
    <comment_count>2</comment_count>
    <who name="Andrey Cherepanov">cas</who>
    <bug_when>2024-01-29 15:19:22 +0300</bug_when>
    <thetext>Код 15-летней давности. Можете прислать патч или обратитесь к текущим мейнтейнерам: https://github.com/abstrakraft/cwiid/issues</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>