Re: [libvirt] [PATCH 7/9] Separate out code for sending tunnelled data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Oct 05, 2009 at 03:29:47PM +0200, Paolo Bonzini wrote:
> On 10/05/2009 01:44 PM, Daniel P. Berrange wrote:
> >+    char buffer[65536];
> >+    int nbytes = sizeof(buffer);
> 
> I just noticed this, it's safer to malloc such a big array  (it is 
> actually from Chris patch, but you may take the opportunity to fix it).

Yes, that's a good point. 

Someday we should also consider getting rid of every occurrance of

  char buf[PATH_MAX]

since POSIX doesn't require PATH_MAX to be defined, and explicitly allows
it to have a value so large that it could never be allocated on the stack
or heap. Though its unlikely that we'd come across such an OS, its good
to avoid potentially large stack arrays.


Daniel
-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
Libvir-list mailing list
Libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]