~grimler/Heimdall

46be0648a627ac6a2037eb464bf72bb769a74f07 — Andrew Griffiths 4 months ago 02b577e
fix overflow in total bytes packet on 32 bit platforms

Updated TotalBytesPacket logic to use uint64_t values rather than
unsigned long for consistent width regardless of platform.
1 files changed, 6 insertions(+), 3 deletions(-)

M heimdall/source/TotalBytesPacket.h
M heimdall/source/TotalBytesPacket.h => heimdall/source/TotalBytesPacket.h +6 -3
@@ 21,6 21,9 @@
#ifndef TOTALBYTESPACKET_H
#define TOTALBYTESPACKET_H

// C++ Standard Library
#include <cstdint>

// Heimdall
#include "SessionSetupPacket.h"



@@ 30,16 33,16 @@ namespace Heimdall
	{
		private:

			unsigned long totalBytes;
			uint64_t totalBytes;

		public:

			TotalBytesPacket(unsigned long totalBytes) : SessionSetupPacket(SessionSetupPacket::kTotalBytes)
			TotalBytesPacket(uint64_t totalBytes) : SessionSetupPacket(SessionSetupPacket::kTotalBytes)
			{
				this->totalBytes = totalBytes;
			}

			unsigned long GetTotalBytes(void) const
			uint64_t GetTotalBytes(void) const
			{
				return (totalBytes);
			}