Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Check for offset bounds before using it
Browse files Browse the repository at this point in the history
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
  • Loading branch information
zyga committed Sep 12, 2016
1 parent 8b37cb4 commit 281cadb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mount-support.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,9 +412,9 @@ static char * __attribute__ ((used))
if (offset >= fulllen)
return NULL;

while (path[offset] != '\0' && offset < fulllen)
while (offset < fulllen && path[offset] != '\0')
offset++;
while (path[offset] == '\0' && offset < fulllen)
while (offset < fulllen && path[offset] == '\0')
offset++;

*offsetp = offset;
Expand Down

0 comments on commit 281cadb

Please sign in to comment.