Skip to content

Commit

Permalink
blah
Browse files Browse the repository at this point in the history
  • Loading branch information
ragusaa committed Jul 28, 2023
1 parent 4f265dd commit 5a28b15
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 26 deletions.
13 changes: 5 additions & 8 deletions libclamav/udf.c
Original file line number Diff line number Diff line change
Expand Up @@ -827,20 +827,17 @@ cl_error_t cli_scanudf(cli_ctx *ctx, const size_t offset)
if (tagId) {
switch (tagId) {
case FILE_IDENTIFIER_DESCRIPTOR: {
cl_error_t temp;

if (CL_SUCCESS != (temp = findFileIdentifiers(buffer, &fileIdentifierList))) {
cl_error_t temp = findFileIdentifiers(buffer, &fileIdentifierList);
if (CL_SUCCESS != temp) {
ret = temp;
goto done;
}
break;
}

case FILE_ENTRY_DESCRIPTOR:

{
cl_error_t temp;
if (CL_SUCCESS != (temp = findFileEntries(buffer, &fileEntryList))) {
case FILE_ENTRY_DESCRIPTOR: {
cl_error_t temp = findFileEntries(buffer, &fileEntryList);
if (CL_SUCCESS != temp) {
ret = temp;
goto done;
}
Expand Down
36 changes: 18 additions & 18 deletions libclamav/udf.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,7 @@
#pragma pack 1
#endif

#ifdef HAVE_PRAGMA_PACK
#pragma pack()
#endif

#ifdef HAVE_PRAGMA_PACK_HPPA
#pragma pack
#endif

typedef struct {
typedef struct __attribute__((packed)) {
uint16_t typeTimeZone; /*
0 Coordinated UTC
1 Local Time
Expand Down Expand Up @@ -105,7 +97,7 @@ typedef struct __attribute__((packed)) {
uint32_t tagLocation;
} DescriptorTag;

typedef struct {
typedef struct __attribute__((packed)) {
uint8_t flags;
/*
* 1/7.4
Expand Down Expand Up @@ -271,7 +263,7 @@ static inline size_t getFileEntryDescriptorSize(const FileEntryDescriptor* fed)
return FILE_ENTRY_DESCRIPTOR_SIZE_KNOWN + fed->extendedAttrLen + fed->allocationDescLen;
}

typedef struct {
typedef struct __attribute__((packed)) {
DescriptorTag tag;

ICBTag icbTag;
Expand Down Expand Up @@ -325,15 +317,15 @@ typedef struct {

} ExtendedFileEntryDescriptor;

typedef struct {
typedef struct __attribute__((packed)) {

uint32_t length;

uint32_t position;

} short_ad;

typedef struct {
typedef struct __attribute__((packed)) {
uint32_t extentLen;
uint32_t recordedLen;

Expand All @@ -344,14 +336,14 @@ typedef struct {
uint8_t implementationUse[2];
} ext_ad;

typedef struct {
typedef struct __attribute__((packed)) {
uint32_t extentLength;

uint32_t extentLocation;

} extent_ad;

typedef struct {
typedef struct __attribute__((packed)) {

DescriptorTag tag;

Expand Down Expand Up @@ -456,13 +448,13 @@ typedef struct __attribute__((packed)) {
9-255 Reserved for future standardisation.
*
*/
typedef struct {
typedef struct __attribute__((packed)) {
uint8_t charSetType;

uint8_t charSetInfo[63];
} charspec;

typedef struct {
typedef struct __attribute__((packed)) {

DescriptorTag tag;

Expand Down Expand Up @@ -492,7 +484,7 @@ typedef struct {

} LogicalVolumeDescriptor;

typedef struct {
typedef struct __attribute__((packed)) {
DescriptorTag tag;
timestamp recordingDateTime;

Expand Down Expand Up @@ -522,6 +514,14 @@ typedef struct {

} FileSetDescriptor;

#ifdef HAVE_PRAGMA_PACK
#pragma pack()
#endif

#ifdef HAVE_PRAGMA_PACK_HPPA
#pragma pack
#endif

cl_error_t cli_scanudf(cli_ctx* ctx, size_t offset);

#endif /* _UDF_H_ */

0 comments on commit 5a28b15

Please sign in to comment.