File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ static int raw_to_header(mtar_header_t *h, const mtar_raw_header_t *rh) {
105105 /* Load raw header into header */
106106 sscanf (rh -> mode , "%o" , & h -> mode );
107107 sscanf (rh -> owner , "%o" , & h -> owner );
108- sscanf (rh -> size , "%lo " , & h -> size );
108+ sscanf (rh -> size , "%12lo " , & h -> size );
109109 sscanf (rh -> mtime , "%o" , & h -> mtime );
110110 h -> type = rh -> type ;
111111 strcpy (h -> name , rh -> name );
@@ -332,6 +332,9 @@ int mtar_write_header(mtar_t *tar, const mtar_header_t *h) {
332332
333333int mtar_write_file_header (mtar_t * tar , const char * name , mtar_size_t size ) {
334334 mtar_header_t h ;
335+ if (size >= 0777777777777 ) {
336+ return MTAR_EFAILURE ;
337+ }
335338 /* Build header */
336339 memset (& h , 0 , sizeof (h ));
337340 strcpy (h .name , name );
You can’t perform that action at this time.
0 commit comments