diff mbox

UBSAN: Undefined behaviour in sound/core/timer.c

Message ID s5hlgb4eieq.wl-tiwai@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Takashi Iwai June 24, 2018, 7:46 a.m. UTC
On Sun, 24 Jun 2018 09:11:42 +0200,
air icy wrote:
> 
> Hi Takashi,
> 
> You are a responsible man.
> I repro this bug in *https://github.com/lcytxw/bug_repro/tree/master/bug_200213
> <https://github.com/lcytxw/bug_repro/tree/master/bug_200213>*
> This patch is ok since I can't repro this bug anymore.

Good to hear.

Would you like put your reported-by and tested-by tags?
If yes, please give it explicitly.  It's be better to give a real name
than a nick name there in general.

Oh, and your another report for seq_client.c should be handled
similarly, a patch like below.  Please give it a try.


thanks,

Takashi

---
diff mbox

Patch

--- a/sound/core/seq/seq_clientmgr.c
+++ b/sound/core/seq/seq_clientmgr.c
@@ -2004,7 +2004,8 @@  static int snd_seq_ioctl_query_next_client(struct snd_seq_client *client,
 	struct snd_seq_client *cptr = NULL;
 
 	/* search for next client */
-	info->client++;
+	if (info->client < INT_MAX)
+		info->client++;
 	if (info->client < 0)
 		info->client = 0;
 	for (; info->client < SNDRV_SEQ_MAX_CLIENTS; info->client++) {