| 
            
            
            
              | 
                
               | 
            
            
            
              | 
                
                  libvirt
                  /
                  libvirt
               | 
            
            
            
              | 
                 
                   
                  v3.7-maint
                 
               | 
            
            
            
              
                 
               | 
            
            
              | 
                Build #1050 has errored
               | 
            
            
              
                 
                
                   
                  11 minutes and 31 seconds
                 
               | 
            
            
              
                
                  
                     Laine Stump
                   
                 
                
               | 
            
            
              | 
                 vbox: fix SEGV during dumpxml of a serial port
  commit 77a12987a48 changed the "virDomainChrSourceDef source" inside virDomainChrDef to "virDomainChrSourceDefPtr source", and started allocating source inside virDomainChrDefNew(), but vboxDumpSerial() was allocating a virDomainChrDef with a simple VIR_ALLOC() (i.e. never calling virDomainChrDefNew()), so source was never initialized, leading to a SEGV any time a serial port was present. The same problem was created in vboxDumpParallel().
  This patch changes vboxDumpSerial() and vboxDumpParallel() to use virDomainChrDefNew() instead of VIR_ALLOC(), and changes both of those functions to return an error if virDomainChrDef() (or any other allocation) fails.
  This resolves: https://bugzilla.redhat.com/1536649
  (cherry picked from commit 9c27e464e3b4603cbe13c00787f4c89e5b1e7a68)
  Signed-off-by: Laine Stump <laine@laine.org> 
               |