diff options
author | Olivier Martin <olivier.martin@arm.com> | 2015-04-02 13:51:28 +0000 |
---|---|---|
committer | oliviermartin <oliviermartin@Edk2> | 2015-04-02 13:51:28 +0000 |
commit | 80d313972410fef01ad9575a78b302dd521e968b (patch) | |
tree | 206e0293e5f446d5ca07ecadf9c0c388501c1a06 /ArmPkg/Library | |
parent | f22e9658954c53ebb7336de5e96492f2348dbda1 (diff) | |
download | edk2-80d313972410fef01ad9575a78b302dd521e968b.zip edk2-80d313972410fef01ad9575a78b302dd521e968b.tar.gz edk2-80d313972410fef01ad9575a78b302dd521e968b.tar.bz2 |
ArmPkg/BaseMemoryLib(Sym|Vstm): Do not post increment returned pointer
InternalMemScanMem(8|16|32|64) was returning a pointer that was
post incremented from the expected returned value.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Ronald Cron <ronald.cron@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17108 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ArmPkg/Library')
-rwxr-xr-x | ArmPkg/Library/BaseMemoryLibStm/MemLibGeneric.c | 12 | ||||
-rwxr-xr-x | ArmPkg/Library/BaseMemoryLibVstm/MemLibGeneric.c | 12 |
2 files changed, 16 insertions, 8 deletions
diff --git a/ArmPkg/Library/BaseMemoryLibStm/MemLibGeneric.c b/ArmPkg/Library/BaseMemoryLibStm/MemLibGeneric.c index ef78748..54c2701 100755 --- a/ArmPkg/Library/BaseMemoryLibStm/MemLibGeneric.c +++ b/ArmPkg/Library/BaseMemoryLibStm/MemLibGeneric.c @@ -162,9 +162,10 @@ InternalMemScanMem8 ( Pointer = (CONST UINT8*)Buffer;
do {
- if (*(Pointer++) == Value) {
+ if (*Pointer == Value) {
return Pointer;
}
+ Pointer++;
} while (--Length != 0);
return NULL;
}
@@ -192,9 +193,10 @@ InternalMemScanMem16 ( Pointer = (CONST UINT16*)Buffer;
do {
- if (*(Pointer++) == Value) {
+ if (*Pointer == Value) {
return Pointer;
}
+ Pointer++;
} while (--Length != 0);
return NULL;
}
@@ -222,9 +224,10 @@ InternalMemScanMem32 ( Pointer = (CONST UINT32*)Buffer;
do {
- if (*(Pointer++) == Value) {
+ if (*Pointer == Value) {
return Pointer;
}
+ Pointer++;
} while (--Length != 0);
return NULL;
}
@@ -252,9 +255,10 @@ InternalMemScanMem64 ( Pointer = (CONST UINT64*)Buffer;
do {
- if (*(Pointer++) == Value) {
+ if (*Pointer == Value) {
return Pointer;
}
+ Pointer++;
} while (--Length != 0);
return NULL;
}
diff --git a/ArmPkg/Library/BaseMemoryLibVstm/MemLibGeneric.c b/ArmPkg/Library/BaseMemoryLibVstm/MemLibGeneric.c index ef78748..54c2701 100755 --- a/ArmPkg/Library/BaseMemoryLibVstm/MemLibGeneric.c +++ b/ArmPkg/Library/BaseMemoryLibVstm/MemLibGeneric.c @@ -162,9 +162,10 @@ InternalMemScanMem8 ( Pointer = (CONST UINT8*)Buffer;
do {
- if (*(Pointer++) == Value) {
+ if (*Pointer == Value) {
return Pointer;
}
+ Pointer++;
} while (--Length != 0);
return NULL;
}
@@ -192,9 +193,10 @@ InternalMemScanMem16 ( Pointer = (CONST UINT16*)Buffer;
do {
- if (*(Pointer++) == Value) {
+ if (*Pointer == Value) {
return Pointer;
}
+ Pointer++;
} while (--Length != 0);
return NULL;
}
@@ -222,9 +224,10 @@ InternalMemScanMem32 ( Pointer = (CONST UINT32*)Buffer;
do {
- if (*(Pointer++) == Value) {
+ if (*Pointer == Value) {
return Pointer;
}
+ Pointer++;
} while (--Length != 0);
return NULL;
}
@@ -252,9 +255,10 @@ InternalMemScanMem64 ( Pointer = (CONST UINT64*)Buffer;
do {
- if (*(Pointer++) == Value) {
+ if (*Pointer == Value) {
return Pointer;
}
+ Pointer++;
} while (--Length != 0);
return NULL;
}
|