Git Product home page Git Product logo

fru_tools's People

Contributors

amiclaus avatar dbogdan avatar iuliacmoldovan avatar mbancisor avatar mhennerich avatar nunojsa avatar rgetz avatar ulrich-teichert-kk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fru_tools's Issues

custom fields are only ASCII & we are running out of room in 256 bytes...

When we try to have longer serial numbers, we quickly run out of room...

rgetz@brain:~/github/fru_tools$ ./fru-dump ./masterfiles/AD-FMCOMMS3-EBZ-FRU.bin -s 123456789012345 -t 0123456789 -d now -o fru.bin 
read 251 bytes from ./masterfiles/AD-FMCOMMS3-EBZ-FRU.bin
changing serial number to 123456789012345
changing tuning parameter to '0123456789'
changing date to Sun Dec 19 19:36:00 2021
fru_dump 0.8.1.6, built 18Dec2021
Not able to pack things into 255 char, no output

This is because the custom fields are tagged as binary, and can not be packed.
This is because the overall header is using 8-byte offsets, so some null padding happens...

The easy solution is to pack the custom fields.

Crashes when called with -b

Hi,

fru-dump crashes when called with -b:
root:~# ./fru-dump -v -b -i /sys/bus/i2c/devices/0-0050/eeprom
read 256 bytes from /sys/bus/i2c/devices/0-0050/eeprom
Date of Man : Mon Jan 1 00:00:00 1996
Manufacturer : XXXXXXX
Product Name : XXXXXXX
Serial Number :
Part Number :
FRU File ID :
Custom Fields:
Field 0 (len=2): 61 00 |a.|
Segmentation fault

The simple reason is that a NULL-pointer check in free_FRU is missing. I can provide a patch if that's of interest,
CU,
Uli

free_FRU() catches SIGSEGV

free_FRU() catches SIGSEGV in case fru->MultiRecord_Area == NULL
Command line was "fru-dump -b "

Program received signal SIGSEGV, Segmentation fault.
0x0000555555556b22 in free_FRU (fru=0x55555555d890) at fru.c:647
647 free(fru->MultiRecord_Area->supplies[j]);
(gdb) bt
#0 0x0000555555556b22 in free_FRU (fru=0x55555555d890) at fru.c:647
#1 0x000055555555585a in main (argc=, argv=) at operating-system.c:568
(gdb) p fru
$1 = (struct FRU_DATA *) 0x55555555d890
(gdb) p *fru
$2 = {Internal_Area = 0x0, Chassis_Info = 0x0, Board_Area = 0x55555555d8c0, Product_Info = 0x0, MultiRecord_Area = 0x0}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.