Wind4 / vlmcsd

KMS Emulator in C (currently runs on Linux including Android, FreeBSD, Solaris, Minix, Mac OS, iOS, Windows with or without Cygwin)
https://forums.mydigitallife.net/threads/50234
8.43k stars 2.29k forks source link

Build (make) fails with the getEpid function? #90

Open remcodelange opened 7 months ago

remcodelange commented 7 months ago

The docker compose build fails. Im using this dockerfile:

FROM alpine:latest as builder
WORKDIR /root
RUN apk add --no-cache git make build-base && \
    git clone --branch master --single-branch https://github.com/Wind4/vlmcsd.git && \
    cd vlmcsd/ && \
    make

FROM alpine:latest
WORKDIR /root/
COPY --from=builder /root/vlmcsd/bin/vlmcsd /usr/bin/vlmcsd
EXPOSE 1688/tcp
CMD [ "/usr/bin/vlmcsd", "-D", "-d" ]

Then i get this error with the make command:

kms.c: In function 'getEpid':
kms.c:502:9: warning: dangling pointer 'pid' to 'ePid' may be used [-Wdangling-pointer=]
  502 |         getEpidFromString(baseResponse, pid);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kms.c:473:30: note: 'ePid' declared here
  473 |                         char ePid[PID_BUFFER_SIZE];
      |                              ^~~~
        LD      ../bin/vlmcsd <- vlmcsd.o kmsdata.o crypto.o kms.o endian.o output.o shared_globals.o helpers.o network.o rpc.o crypto_internal.o
        LD      ../bin/vlmcs <- vlmcs.o kmsdata-full.o crypto.o kms.o endian.o output.o shared_globals.o helpers.o network.o rpc.o crypto_internal.o dns_srv.o
gmake[1]: Leaving directory '/root/vlmcsd/src'

Can you guys help me?

Zarniwoops commented 6 months ago

This is a bug in the code that needs to be patched.

The problem:

Quick fix:

remcodelange commented 6 months ago

Thank you, I feel like an idiot. Just changed the kms.c file and moved the line 473 to after 467 and now it works again.