RE: [patch] bfa: clean up some bounds checking

2016-07-01 Thread Sudarsana Kalluru
;; Sudarsana Kalluru <sudarsana.kall...@qlogic.com>; James E.J. Bottomley <j...@linux.vnet.ibm.com>; Martin K. Petersen <martin.peter...@oracle.com>; linux-scsi <linux-scsi@vger.kernel.org>; kernel-janit...@vger.kernel.org Subject: Re: [patch] bfa: clean up some bounds chec

Re: [patch] bfa: clean up some bounds checking

2016-06-16 Thread walter harms
Am 16.06.2016 12:44, schrieb Dan Carpenter: > This code is supposed to search ->adapter_hwpath[] and replace the > second colon with a NUL character. Unfortunately, the boundary checks > that ensure we don't go beyond the end of the buffer have a couple > problems. > > Imagine that the string

[patch] bfa: clean up some bounds checking

2016-06-16 Thread Dan Carpenter
This code is supposed to search ->adapter_hwpath[] and replace the second colon with a NUL character. Unfortunately, the boundary checks that ensure we don't go beyond the end of the buffer have a couple problems. Imagine that the string has no colons. In that case, in the first loop, we read