[LSASRV] - Correctly set return values in LsapGetObjectAttribute

[CDMAKE] - Handle out-of-memory condition
- Patch by Samuel Serapion

svn path=/trunk/; revision=54866
This commit is contained in:
Thomas Faber 2012-01-07 17:45:26 +00:00
parent f2d3731646
commit 900f2cecbe
2 changed files with 4 additions and 2 deletions

View file

@ -510,13 +510,13 @@ LsapGetObjectAttribute(PLSA_DB_OBJECT DbObject,
if (AttributeData == NULL || *AttributeSize == 0) if (AttributeData == NULL || *AttributeSize == 0)
{ {
*AttributeSize = ValueSize; *AttributeSize = ValueSize;
Status == STATUS_SUCCESS; Status = STATUS_SUCCESS;
goto Done; goto Done;
} }
else if (*AttributeSize < ValueSize) else if (*AttributeSize < ValueSize)
{ {
*AttributeSize = ValueSize; *AttributeSize = ValueSize;
Status == STATUS_BUFFER_OVERFLOW; Status = STATUS_BUFFER_OVERFLOW;
goto Done; goto Done;
} }

View file

@ -633,6 +633,8 @@ void parse_filename_into_dirrecord ( const char* filename, PDIR_RECORD d, BOOL d
if (joliet_length > 64) if (joliet_length > 64)
error_exit ( "'%s' is not Joliet, aborting...", filename ); error_exit ( "'%s' is not Joliet, aborting...", filename );
d->joliet_name = malloc(joliet_length + 1); d->joliet_name = malloc(joliet_length + 1);
if (d->joliet_name == NULL)
error_exit("Insufficient memory");
strcpy(d->joliet_name, filename); strcpy(d->joliet_name, filename);
} }
} }