forked from pool/xfsdump
22 lines
529 B
Diff
22 lines
529 B
Diff
|
Index: xfsdump-3.0.1/common/path.c
|
||
|
===================================================================
|
||
|
--- xfsdump-3.0.1.orig/common/path.c
|
||
|
+++ xfsdump-3.0.1/common/path.c
|
||
|
@@ -283,11 +283,15 @@ pa_gen( pa_t *pap )
|
||
|
|
||
|
sz = 0;
|
||
|
for ( i = 0 ; i < pap->pa_cnt ; i++ ) {
|
||
|
sz += strlen( pap->pa_array[ i ] ) + 1;
|
||
|
}
|
||
|
- sz++;
|
||
|
+ sz++; /* '\0' */
|
||
|
+ /* if pa_cnt == 0, then we need '/' + '\0' */
|
||
|
+ if ( pap->pa_cnt <= 0 ) {
|
||
|
+ sz++;
|
||
|
+ }
|
||
|
|
||
|
retp = ( char * )malloc( sz );
|
||
|
|
||
|
if ( pap->pa_cnt <= 0 ) {
|
||
|
ASSERT( pap->pa_cnt == 0 );
|