Index: branches/JrCs/i386/libsaio/convert.c =================================================================== --- branches/JrCs/i386/libsaio/convert.c (revision 77) +++ branches/JrCs/i386/libsaio/convert.c (revision 78) @@ -21,15 +21,18 @@ return msg; } -/** Parse an UUID string into an (EFI_CHAR8*) buffer */ -EFI_CHAR8* getUUIDFromString(const char *source) +/* Parse an UUID string into an (EFI_CHAR8*) buffer + * Return a new allocated uuid + */ +EFI_CHAR8* newUUIDFromString(const char *source) { if (! source) return NULL; char* p = (char*) source; int i; char buf[3]; - static EFI_CHAR8 uuid[UUID_LEN+1]=""; + EFI_CHAR8 uuid[UUID_LEN+1]; + EFI_CHAR8* result; buf[2] = '\0'; for (i=0; i < UUID_LEN; i++) { @@ -48,7 +51,11 @@ if (*p != '\0') { return NULL; } - return uuid; + + result = malloc(UUID_LEN+1); + bcopy(uuid, result, UUID_LEN+1); + + return result; } /** XXX AsereBLN replace by strtoul */ Index: branches/JrCs/i386/libsaio/convert.h =================================================================== --- branches/JrCs/i386/libsaio/convert.h (revision 77) +++ branches/JrCs/i386/libsaio/convert.h (revision 78) @@ -12,7 +12,7 @@ #define UUID_LEN 16 const char * getStringFromUUID(const EFI_CHAR8* uuid); -EFI_CHAR8* getUUIDFromString(const char *source); +EFI_CHAR8* newUUIDFromString(const char *source); void *convertHexStr2Binary(const char *hexStr, int *outLength); uint32_t ascii_hex_to_int(char *buff); Index: branches/JrCs/i386/libsaio/fake_efi.c =================================================================== --- branches/JrCs/i386/libsaio/fake_efi.c (revision 77) +++ branches/JrCs/i386/libsaio/fake_efi.c (revision 78) @@ -334,17 +334,16 @@ */ static const EFI_CHAR8* getSystemID() { - bool pause = FALSE; int len; - const char* StrSystemId = NULL; - const EFI_CHAR8* SystemId = NULL; + const char* StrSystemId = NULL; + const EFI_CHAR8* SystemId = NULL; // unable to determine UUID for host. Error: 35 fix getValueForKey(kSystemID, &StrSystemId, &len, &bootInfo->bootConfig); if (StrSystemId != NULL) { - SystemId = getUUIDFromString(StrSystemId); + SystemId = newUUIDFromString(StrSystemId); if (SystemId == NULL) { error("Error: invalid SystemID '%s'\n", StrSystemId); pause = TRUE;