open-iscsi / open-isns

iSNS server and client for Linux
GNU Lesser General Public License v2.1
26 stars 22 forks source link

minor fixes to resolve static code analysis complaints #44

Closed cleech closed 6 months ago

cleech commented 7 months ago

As part of ongoing code scanning and hardening efforts here at Red Hat, I had a list of possible "weaknesses" assigned to look at. There are a some real bugs here, and memory leaks in error paths that matter for long running processes but not as much for isnsadm.

cleech commented 7 months ago

I would appreciate another set of eyes on this one. I can see the msg_buf leak, but I can't make sense of where it's supposed to be used? Does this de-fragmentation code even work?

That didn't link to the commit like I expected it to. It's "isns_msg_complete: msg_buf resource leak"

gonzoleeman commented 6 months ago

I will review today.

On Apr 17, 2024, at 11:49 AM, Chris Leech @.***> wrote:

I would appreciate another set of eyes on this one. I can see the msg_buf leak, but I can't make sense of where it's supposed to be used? Does this de-fragmentation code even work?

That didn't link to the commit like I expected it to. It's "isns_msg_complete: msg_buf resource leak"

— Reply to this email directly, view it on GitHub https://github.com/open-iscsi/open-isns/pull/44#issuecomment-2061986530, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOJGHFBQ2ALJWBYALJ3JMDY5272FAVCNFSM6AAAAABGL3OUEOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRRHE4DMNJTGA. You are receiving this because you are subscribed to this thread.

gonzoleeman commented 6 months ago

I'm half way through looking at this ... still working on it

gonzoleeman commented 6 months ago

I would appreciate another set of eyes on this one. I can see the msg_buf leak, but I can't make sense of where it's supposed to be used? Does this de-fragmentation code even work?

I believe the transfer is done as side effects in the buffer functions. :O

gonzoleeman commented 6 months ago

Thank you Chris!