alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* bug report: aloop: potential signedness bug in loopback_prepare()
@ 2010-10-09 11:42 Dan Carpenter
  2010-10-09 12:14 ` Jaroslav Kysela
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2010-10-09 11:42 UTC (permalink / raw)
  To: Jaroslav Kysela; +Cc: alsa-devel

Hi Jaroslav,

sound/drivers/aloop.c +287 loopback_prepare(10)
	warn: bogus compare against zero: 'bps'
   282          unsigned int bps, salign;
   283
   284          salign = (snd_pcm_format_width(runtime->format) *
   285							runtime->channels) / 8;
   286          bps = salign * runtime->rate;
   287          if (bps <= 0 || salign <= 0)
                    ^^^^^^^^^^^^^^^^^^^^^^^

	Both "bps" and "salign" are unsigned and are never less than
	zero.  Should this just be checking for == 0?  Or was the check
	supposed to catch integer overflows?

   288                  return -EINVAL;
   289

regards,
dan carpenter

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

end of thread, other threads:[~2010-10-09 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-09 11:42 bug report: aloop: potential signedness bug in loopback_prepare() Dan Carpenter
2010-10-09 12:14 ` Jaroslav Kysela
2010-10-09 14:58   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).