[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: different CVS_SERVER for different hosts
From: |
Mihai Bazon |
Subject: |
Re: different CVS_SERVER for different hosts |
Date: |
29 Oct 2003 14:22:05 +0200 |
On Wed, 2003-10-29 at 11:57, Mark D. Baushke wrote:
> I sent private code review comments to Mihai, but it is worth noting one
> that is a 'security' concern. Do not assume that the file is not
> a zero-length file. Check that the len > 0 before potentially changing
> '\n' bytes into '\0' bytes at the end of it.
Sorry to have to contradict you about the above. My code looks like
this:
char *res = fgets(buf, sizeof(buf), f);
fclose(f);
if (!res)
// forget it
break;
For a zero-length file fgets returns NULL so we exit before removing the
last newline character.
Breaking C89 guidelines is, well, something I usually don't care.. I am
a former C++ programmer and this gave me some real bad habits--or good,
depends on how you're seeing it ;-)
But thanks for your notes, I'll keep them in mind if I submit other
code.
Regards,
--
Mihai Bazon,
http://dynarch.com/mishoo/ [ applied W3 ]
- different CVS_SERVER for different hosts, Mihai Bazon, 2003/10/29
- Re: different CVS_SERVER for different hosts, Mark D. Baushke, 2003/10/29
- Re: different CVS_SERVER for different hosts, Mihai Bazon, 2003/10/29
- Re: different CVS_SERVER for different hosts, Mark D. Baushke, 2003/10/29
- Re: different CVS_SERVER for different hosts,
Mihai Bazon <=
- Re: different CVS_SERVER for different hosts, Derek Robert Price, 2003/10/29
- Re: different CVS_SERVER for different hosts, Mark D. Baushke, 2003/10/29
- Message not available
- Re: different CVS_SERVER for different hosts, Paul Edwards, 2003/10/29
- Re: different CVS_SERVER for different hosts, Mark D. Baushke, 2003/10/29
- Re: different CVS_SERVER for different hosts, Derek Robert Price, 2003/10/30
- Message not available
- Re: different CVS_SERVER for different hosts, Paul Edwards, 2003/10/30
- Re: different CVS_SERVER for different hosts, Derek Robert Price, 2003/10/30
- Message not available
- Re: different CVS_SERVER for different hosts, Paul Edwards, 2003/10/30
- Re: different CVS_SERVER for different hosts, Derek Robert Price, 2003/10/30
- Re: different CVS_SERVER for different hosts, Larry Jones, 2003/10/30